CropTypes

This commit is contained in:
Joel 2020-05-06 21:52:30 +02:00
parent 75f9eb23ca
commit 7fd69946fe
5 changed files with 171 additions and 1 deletions

View File

@ -168,7 +168,7 @@ namespace Game1
for (int i = 0; i < 5; i++)
{
spriteBatch.Draw(ProgressionBar, new Rectangle(i * 227, (int)(input.getSize().Y * (input.getTileSize() + input.getSpacing())), 5, 300), Color.White);
spriteBatch.Draw(ProgressionBar, new Rectangle(i * 227, (int)(input.getSize().Y * (input.getTileSize() + input.getSpacing())), 5, 295), Color.White);
}
for (int i = 0; i < 15; i++)
{

View File

@ -67,6 +67,8 @@
<Compile Include="Game1.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Sources\Crops\CropType.cs" />
<Compile Include="Sources\Crops\CropTypesHolder.cs" />
<Compile Include="Sources\Crops\SoilProperties.cs" />
<Compile Include="Sources\Objects\DayNightCycle.cs" />
<Compile Include="Sources\Objects\HandleRotation.cs" />

View File

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
class CropTypes
{
public string[] soilType;
public int[] Times;
public float Temparature;
public float Humidity;
public float Moisture;
public float Nitrogen;
public float Potassium;
public float Phosphorous;
}

View File

@ -0,0 +1,147 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
class CropTypesHolder
{
private CropTypes[] cropTypes = new CropTypes[11];
public void init()
{
// Barley
cropTypes[0].soilType[0] = "Sandy";
cropTypes[0].soilType[1] = null;
cropTypes[0].soilType[2] = null;
cropTypes[0].Temparature = 30.1f;
cropTypes[0].Humidity = 59.0f;
cropTypes[0].Moisture = 41.7f;
cropTypes[0].Nitrogen = 12.6f;
cropTypes[0].Potassium = 5.3f;
cropTypes[0].Phosphorous = 26.0f;
// Cotton
cropTypes[1].soilType[0] = "Red";
cropTypes[1].Times[0] = 5;
cropTypes[1].soilType[1] = "Black";
cropTypes[1].Times[1] = 4;
cropTypes[1].soilType[2] = "Loamy";
cropTypes[1].Times[2] = 3;
cropTypes[1].Temparature = 30.4f;
cropTypes[1].Humidity = 59.6f;
cropTypes[1].Moisture = 63.2f;
cropTypes[1].Nitrogen = 16.4f;
cropTypes[1].Potassium = 3.3f;
cropTypes[1].Phosphorous = 23.8f;
// Ground Nuts
cropTypes[2].soilType[0] = "Red";
cropTypes[2].soilType[1] = null;
cropTypes[2].soilType[2] = null;
cropTypes[2].Temparature = 30.1f;
cropTypes[2].Humidity = 59.1f;
cropTypes[2].Moisture = 33.1f;
cropTypes[2].Nitrogen = 23.3f;
cropTypes[2].Potassium = 2.0f;
cropTypes[2].Phosphorous = 21.6f;
// Maize
cropTypes[3].soilType[0] = "Sandy";
cropTypes[3].soilType[1] = null;
cropTypes[3].soilType[2] = null;
cropTypes[3].Temparature = 29.0f;
cropTypes[3].Humidity = 57.3f;
cropTypes[3].Moisture = 42.2f;
cropTypes[3].Nitrogen = 18.3f;
cropTypes[3].Potassium = 5.7f;
cropTypes[3].Phosphorous = 18.7f;
// Millets
cropTypes[4].soilType[0] = "Sandy";
cropTypes[4].Times[0] = 7;
cropTypes[4].soilType[1] = "Black";
cropTypes[4].Times[0] = 4;
cropTypes[4].soilType[2] = null;
cropTypes[4].Temparature = 29.5f;
cropTypes[4].Humidity = 57.3f;
cropTypes[4].Moisture = 38.5f;
cropTypes[4].Nitrogen = 23.2f;
cropTypes[4].Potassium = 0;
cropTypes[4].Phosphorous = 14.4f;
//Oil Seeds
cropTypes[5].soilType[0] = "Black";
cropTypes[5].soilType[1] = null;
cropTypes[5].soilType[2] = null;
cropTypes[5].Temparature = 30.3f;
cropTypes[5].Humidity = 59.1f;
cropTypes[5].Moisture = 32.1f;
cropTypes[5].Nitrogen = 19.0f;
cropTypes[5].Potassium = 2.3f;
cropTypes[5].Phosphorous = 17.3f;
//Paddys
cropTypes[6].soilType[0] = "Clayey";
cropTypes[6].soilType[1] = null;
cropTypes[6].soilType[2] = null;
cropTypes[6].Temparature = 31.2f;
cropTypes[6].Humidity = 60.4f;
cropTypes[6].Moisture = 41.5f;
cropTypes[6].Nitrogen = 20.8f;
cropTypes[6].Potassium = 3.7f;
cropTypes[6].Phosphorous = 16.3f;
//Pulses
cropTypes[7].soilType[0] = "Clayey";
cropTypes[7].soilType[1] = null;
cropTypes[7].soilType[2] = null;
cropTypes[7].Temparature = 27.8f;
cropTypes[7].Humidity = 54.9f;
cropTypes[7].Moisture = 34.1f;
cropTypes[7].Nitrogen = 18.4f;
cropTypes[7].Potassium = 4.2f;
cropTypes[7].Phosphorous = 17.5f;
//Sugarcane
cropTypes[8].soilType[0] = "Loamy";
cropTypes[8].Times[0] = 9;
cropTypes[8].soilType[1] = "Black";
cropTypes[8].Times[0] = 4;
cropTypes[8].soilType[2] = null;
cropTypes[8].Temparature = 30.0f;
cropTypes[8].Humidity = 58.6f;
cropTypes[8].Moisture = 51.2f;
cropTypes[8].Nitrogen = 14.6f;
cropTypes[8].Potassium = 4.2f;
cropTypes[8].Phosphorous = 17.6f;
//Tobacco
cropTypes[9].soilType[0] = "Red";
cropTypes[9].soilType[1] = null;
cropTypes[9].soilType[2] = null;
cropTypes[9].Temparature = 31.9f;
cropTypes[9].Humidity = 62.4f;
cropTypes[9].Moisture = 31.6f;
cropTypes[9].Nitrogen = 19.1f;
cropTypes[9].Potassium = 4.9f;
cropTypes[9].Phosphorous = 19.3f;
//Wheat
cropTypes[10].soilType[0] = "Loamy";
cropTypes[10].soilType[1] = null;
cropTypes[10].soilType[2] = null;
cropTypes[10].Temparature = 33.1f;
cropTypes[10].Humidity = 63.8f;
cropTypes[10].Moisture = 50.0f;
cropTypes[10].Nitrogen = 23.3f;
cropTypes[10].Potassium = 2.9f;
cropTypes[10].Phosphorous = 14.4f;
}
}

View File

@ -11,6 +11,7 @@ class Farm
private Crops[,] crops;
private Random r;
//initializes the crops
public void init(Vector2 Size, Vector2 housepos)
{