ProductionRate
@ -68,6 +68,18 @@
|
|||||||
/processorParam:TextureFormat=Color
|
/processorParam:TextureFormat=Color
|
||||||
/build:house.png
|
/build:house.png
|
||||||
|
|
||||||
|
#begin MaizeIcon.png
|
||||||
|
/importer:TextureImporter
|
||||||
|
/processor:TextureProcessor
|
||||||
|
/processorParam:ColorKeyColor=255,0,255,255
|
||||||
|
/processorParam:ColorKeyEnabled=True
|
||||||
|
/processorParam:GenerateMipmaps=False
|
||||||
|
/processorParam:PremultiplyAlpha=True
|
||||||
|
/processorParam:ResizeToPowerOfTwo=False
|
||||||
|
/processorParam:MakeSquare=False
|
||||||
|
/processorParam:TextureFormat=Color
|
||||||
|
/build:MaizeIcon.png
|
||||||
|
|
||||||
#begin Markers.png
|
#begin Markers.png
|
||||||
/importer:TextureImporter
|
/importer:TextureImporter
|
||||||
/processor:TextureProcessor
|
/processor:TextureProcessor
|
||||||
@ -80,6 +92,18 @@
|
|||||||
/processorParam:TextureFormat=Color
|
/processorParam:TextureFormat=Color
|
||||||
/build:Markers.png
|
/build:Markers.png
|
||||||
|
|
||||||
|
#begin MilletsIcon.png
|
||||||
|
/importer:TextureImporter
|
||||||
|
/processor:TextureProcessor
|
||||||
|
/processorParam:ColorKeyColor=255,0,255,255
|
||||||
|
/processorParam:ColorKeyEnabled=True
|
||||||
|
/processorParam:GenerateMipmaps=False
|
||||||
|
/processorParam:PremultiplyAlpha=True
|
||||||
|
/processorParam:ResizeToPowerOfTwo=False
|
||||||
|
/processorParam:MakeSquare=False
|
||||||
|
/processorParam:TextureFormat=Color
|
||||||
|
/build:MilletsIcon.png
|
||||||
|
|
||||||
#begin Mountain.png
|
#begin Mountain.png
|
||||||
/importer:TextureImporter
|
/importer:TextureImporter
|
||||||
/processor:TextureProcessor
|
/processor:TextureProcessor
|
||||||
@ -104,6 +128,18 @@
|
|||||||
/processorParam:TextureFormat=Color
|
/processorParam:TextureFormat=Color
|
||||||
/build:MouseCursor.png
|
/build:MouseCursor.png
|
||||||
|
|
||||||
|
#begin PaddyIcon.png
|
||||||
|
/importer:TextureImporter
|
||||||
|
/processor:TextureProcessor
|
||||||
|
/processorParam:ColorKeyColor=255,0,255,255
|
||||||
|
/processorParam:ColorKeyEnabled=True
|
||||||
|
/processorParam:GenerateMipmaps=False
|
||||||
|
/processorParam:PremultiplyAlpha=True
|
||||||
|
/processorParam:ResizeToPowerOfTwo=False
|
||||||
|
/processorParam:MakeSquare=False
|
||||||
|
/processorParam:TextureFormat=Color
|
||||||
|
/build:PaddyIcon.png
|
||||||
|
|
||||||
#begin Plantable.png
|
#begin Plantable.png
|
||||||
/importer:TextureImporter
|
/importer:TextureImporter
|
||||||
/processor:TextureProcessor
|
/processor:TextureProcessor
|
||||||
@ -152,6 +188,42 @@
|
|||||||
/processorParam:TextureFormat=Color
|
/processorParam:TextureFormat=Color
|
||||||
/build:ProgressionBarStatus.png
|
/build:ProgressionBarStatus.png
|
||||||
|
|
||||||
|
#begin PulsesIcon.png
|
||||||
|
/importer:TextureImporter
|
||||||
|
/processor:TextureProcessor
|
||||||
|
/processorParam:ColorKeyColor=255,0,255,255
|
||||||
|
/processorParam:ColorKeyEnabled=True
|
||||||
|
/processorParam:GenerateMipmaps=False
|
||||||
|
/processorParam:PremultiplyAlpha=True
|
||||||
|
/processorParam:ResizeToPowerOfTwo=False
|
||||||
|
/processorParam:MakeSquare=False
|
||||||
|
/processorParam:TextureFormat=Color
|
||||||
|
/build:PulsesIcon.png
|
||||||
|
|
||||||
|
#begin SeedOilIcon.png
|
||||||
|
/importer:TextureImporter
|
||||||
|
/processor:TextureProcessor
|
||||||
|
/processorParam:ColorKeyColor=255,0,255,255
|
||||||
|
/processorParam:ColorKeyEnabled=True
|
||||||
|
/processorParam:GenerateMipmaps=False
|
||||||
|
/processorParam:PremultiplyAlpha=True
|
||||||
|
/processorParam:ResizeToPowerOfTwo=False
|
||||||
|
/processorParam:MakeSquare=False
|
||||||
|
/processorParam:TextureFormat=Color
|
||||||
|
/build:SeedOilIcon.png
|
||||||
|
|
||||||
|
#begin SugarcaneIcon.png
|
||||||
|
/importer:TextureImporter
|
||||||
|
/processor:TextureProcessor
|
||||||
|
/processorParam:ColorKeyColor=255,0,255,255
|
||||||
|
/processorParam:ColorKeyEnabled=True
|
||||||
|
/processorParam:GenerateMipmaps=False
|
||||||
|
/processorParam:PremultiplyAlpha=True
|
||||||
|
/processorParam:ResizeToPowerOfTwo=False
|
||||||
|
/processorParam:MakeSquare=False
|
||||||
|
/processorParam:TextureFormat=Color
|
||||||
|
/build:SugarcaneIcon.png
|
||||||
|
|
||||||
#begin Tile.png
|
#begin Tile.png
|
||||||
/importer:TextureImporter
|
/importer:TextureImporter
|
||||||
/processor:TextureProcessor
|
/processor:TextureProcessor
|
||||||
@ -176,6 +248,18 @@
|
|||||||
/processorParam:TextureFormat=Color
|
/processorParam:TextureFormat=Color
|
||||||
/build:tileunplantable.png
|
/build:tileunplantable.png
|
||||||
|
|
||||||
|
#begin TobaccoIcon.png
|
||||||
|
/importer:TextureImporter
|
||||||
|
/processor:TextureProcessor
|
||||||
|
/processorParam:ColorKeyColor=255,0,255,255
|
||||||
|
/processorParam:ColorKeyEnabled=True
|
||||||
|
/processorParam:GenerateMipmaps=False
|
||||||
|
/processorParam:PremultiplyAlpha=True
|
||||||
|
/processorParam:ResizeToPowerOfTwo=False
|
||||||
|
/processorParam:MakeSquare=False
|
||||||
|
/processorParam:TextureFormat=Color
|
||||||
|
/build:TobaccoIcon.png
|
||||||
|
|
||||||
#begin Tractor.png
|
#begin Tractor.png
|
||||||
/importer:TextureImporter
|
/importer:TextureImporter
|
||||||
/processor:TextureProcessor
|
/processor:TextureProcessor
|
||||||
|
BIN
Game1/Content/MaizeIcon.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
Game1/Content/MilletsIcon.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
Game1/Content/PaddyIcon.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
Game1/Content/PulsesIcon.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
Game1/Content/SeedOilIcon.png
Normal file
After Width: | Height: | Size: 631 B |
BIN
Game1/Content/SugarcaneIcon.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
Game1/Content/TobaccoIcon.png
Normal file
After Width: | Height: | Size: 747 B |
@ -14,7 +14,7 @@ namespace Game1
|
|||||||
SpriteBatch spriteBatch;
|
SpriteBatch spriteBatch;
|
||||||
SpriteFont Bold;
|
SpriteFont Bold;
|
||||||
private Texture2D[] tile = new Texture2D[5];
|
private Texture2D[] tile = new Texture2D[5];
|
||||||
private Texture2D[] Crops = new Texture2D[5];
|
private Texture2D[] Crops = new Texture2D[11];
|
||||||
private Texture2D tractor;
|
private Texture2D tractor;
|
||||||
private Texture2D house;
|
private Texture2D house;
|
||||||
private Texture2D markers;
|
private Texture2D markers;
|
||||||
@ -95,13 +95,23 @@ namespace Game1
|
|||||||
tile[0] = Content.Load<Texture2D>("Mountain");
|
tile[0] = Content.Load<Texture2D>("Mountain");
|
||||||
tile[1] = Content.Load<Texture2D>("tileunplantable");
|
tile[1] = Content.Load<Texture2D>("tileunplantable");
|
||||||
tile[2] = Content.Load<Texture2D>("Plantable");
|
tile[2] = Content.Load<Texture2D>("Plantable");
|
||||||
tile[3] = Content.Load<Texture2D>("Planted");
|
tile[3] = Content.Load<Texture2D>("Crop");
|
||||||
tile[4] = Content.Load<Texture2D>("Crop");
|
|
||||||
|
|
||||||
Crops[0] = Content.Load<Texture2D>("CarrotIcon");
|
Crops[0] = Content.Load<Texture2D>("CarrotIcon");
|
||||||
Crops[1] = Content.Load<Texture2D>("WheatIcon");
|
Crops[1] = Content.Load<Texture2D>("WheatIcon");
|
||||||
Crops[2] = Content.Load<Texture2D>("BerriesIcon"); //Replace 2 and 3 with the new crop Textures
|
Crops[2] = Content.Load<Texture2D>("BerriesIcon");
|
||||||
Crops[3] = Content.Load<Texture2D>("TreePlantationIcon");
|
|
||||||
|
|
||||||
|
|
||||||
|
Crops[3] = Content.Load<Texture2D>("MaizeIcon");
|
||||||
|
Crops[4] = Content.Load<Texture2D>("MilletsIcon");
|
||||||
|
Crops[5] = Content.Load<Texture2D>("SeedOilIcon");
|
||||||
|
Crops[6] = Content.Load<Texture2D>("PaddyIcon");
|
||||||
|
Crops[7] = Content.Load<Texture2D>("PulsesIcon");
|
||||||
|
Crops[8] = Content.Load<Texture2D>("SugarcaneIcon");
|
||||||
|
Crops[9] = Content.Load<Texture2D>("TobaccoIcon");
|
||||||
|
Crops[10] = Content.Load<Texture2D>("WheatIcon");
|
||||||
|
|
||||||
|
|
||||||
ProgressionBar = Content.Load<Texture2D>("ProgressionBar");
|
ProgressionBar = Content.Load<Texture2D>("ProgressionBar");
|
||||||
ProgressionBarStatus = Content.Load<Texture2D>("ProgressionBarStatus");
|
ProgressionBarStatus = Content.Load<Texture2D>("ProgressionBarStatus");
|
||||||
@ -217,6 +227,9 @@ namespace Game1
|
|||||||
for (int j = 0; j < input.getSize().Y; j++)
|
for (int j = 0; j < input.getSize().Y; j++)
|
||||||
{
|
{
|
||||||
Rectangle tilePos = new Rectangle(i * (input.getSpacingTile()), j * (input.getSpacingTile()), input.getTileSize(), input.getTileSize());
|
Rectangle tilePos = new Rectangle(i * (input.getSpacingTile()), j * (input.getSpacingTile()), input.getTileSize(), input.getTileSize());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
spriteBatch.Draw(tile[tractorUnit.getFarm().getCrop(i, j).getStatus()], tilePos, Time.GetTimeOfDay());
|
spriteBatch.Draw(tile[tractorUnit.getFarm().getCrop(i, j).getStatus()], tilePos, Time.GetTimeOfDay());
|
||||||
if (tilePos.Intersects(mousePosition))
|
if (tilePos.Intersects(mousePosition))
|
||||||
{
|
{
|
||||||
@ -232,15 +245,22 @@ namespace Game1
|
|||||||
x = i;
|
x = i;
|
||||||
y = j;
|
y = j;
|
||||||
}
|
}
|
||||||
|
if (tractorUnit.getFarm().getCrop(i, j).getStatus() != 0 && tractorUnit.getFarm().getCrop(i, j).getStatus() != 1)
|
||||||
|
{
|
||||||
|
spriteBatch.Draw(Crops[tractorUnit.getFarm().getCrop(i, j).getCropType()], new Rectangle(i * input.getSpacingTile(), j * input.getSpacingTile(), input.getTileSize(), input.getTileSize()), Color.White);
|
||||||
}
|
}
|
||||||
if ((tractorUnit.getFarm().getCrop(i, j).getStatus() == 4))
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (tractorUnit.getFarm().getCrop(i, j).getStatus() != 0 && tractorUnit.getFarm().getCrop(i, j).getStatus() != 1)
|
||||||
|
{
|
||||||
|
if ((tractorUnit.getFarm().getCrop(i, j).getStatus() == 3))
|
||||||
{
|
{
|
||||||
spriteBatch.Draw(ProgressionBar, new Rectangle(i * (input.getSpacingTile()) + input.getTileSize() - input.getTileSize() / 3, j * (input.getSpacingTile()), input.getTileSize() / 3, input.getTileSize()), Color.White);
|
spriteBatch.Draw(ProgressionBar, new Rectangle(i * (input.getSpacingTile()) + input.getTileSize() - input.getTileSize() / 3, j * (input.getSpacingTile()), input.getTileSize() / 3, input.getTileSize()), Color.White);
|
||||||
spriteBatch.Draw(ProgressionBarStatus, new Rectangle(i * (input.getSpacingTile()) + input.getTileSize() - input.getTileSize() / 4, j * (input.getSpacingTile()) + input.getTileSize() / 3, input.getTileSize() / 4, tractorUnit.getFarm().getCrop(i, j).getCropTimerBar((input.getTileSize())) + 1), Color.White);
|
spriteBatch.Draw(ProgressionBarStatus, new Rectangle(i * (input.getSpacingTile()) + input.getTileSize() - input.getTileSize() / 4, j * (input.getSpacingTile()) + input.getTileSize() / 3, input.getTileSize() / 4, tractorUnit.getFarm().getCrop(i, j).getCropTimerBar((input.getTileSize())) + 1), Color.White);
|
||||||
}
|
}
|
||||||
if (tractorUnit.getFarm().getCrop(i, j).getStatus() != 0 && tractorUnit.getFarm().getCrop(i, j).getStatus() != 1)
|
spriteBatch.Draw(Crops[tractorUnit.getFarm().getCrop(i, j).getCropType()], new Rectangle((int)(i * (input.getSpacingTile()) + input.getTileSize() - input.getTileSize() / 2.5), j * (input.getSpacingTile()), (int)(input.getTileSize() / 2.5), input.getTileSize() / 3), Color.White);
|
||||||
{
|
}
|
||||||
spriteBatch.Draw(Crops[tractorUnit.getFarm().getCrop(i, j).getCropType()], new Rectangle(i * (input.getSpacingTile()) + input.getTileSize() - input.getTileSize() / 3, j * (input.getSpacingTile()), input.getTileSize() / 3, input.getTileSize() / 3), Color.White);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ class Controller
|
|||||||
public int controllSpeed(int Speed)
|
public int controllSpeed(int Speed)
|
||||||
{
|
{
|
||||||
KeyboardState state = Keyboard.GetState();
|
KeyboardState state = Keyboard.GetState();
|
||||||
if (state.IsKeyDown(Keys.Right))
|
if (state.IsKeyDown(Keys.Right) && Speed < 350)
|
||||||
{
|
{
|
||||||
Speed++;
|
Speed++;
|
||||||
}
|
}
|
||||||
|
@ -13,21 +13,34 @@ class Crops
|
|||||||
private int originalStatus;
|
private int originalStatus;
|
||||||
private int cropType = 0;
|
private int cropType = 0;
|
||||||
private int Timer = 1;
|
private int Timer = 1;
|
||||||
|
private int UpdateCrop;
|
||||||
private int fullTimer;
|
private int fullTimer;
|
||||||
private bool housePos = false;
|
private bool housePos = false;
|
||||||
private Vector2 Size;
|
private Vector2 Size;
|
||||||
|
private CropTypes DataSet;
|
||||||
SoilProperties soilProperties = new SoilProperties();
|
SoilProperties soilProperties = new SoilProperties();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void updateCrop(Vector2 newSize)
|
public void updateCrop(Vector2 newSize)
|
||||||
{
|
{
|
||||||
|
if (Status == 3 && Timer != 1)
|
||||||
if (Status == 4 && Timer != 1)
|
|
||||||
{
|
{
|
||||||
Timer--;
|
Timer--;
|
||||||
}
|
}
|
||||||
Size = newSize;
|
Size = newSize;
|
||||||
|
UpdateCrop++;
|
||||||
|
if (UpdateCrop == 60)
|
||||||
|
{
|
||||||
|
degradeSoil();
|
||||||
|
UpdateCrop = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public SoilProperties getSoilProperties()
|
||||||
|
{
|
||||||
|
return soilProperties;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getCropTimer()
|
public int getCropTimer()
|
||||||
@ -47,8 +60,6 @@ class Crops
|
|||||||
soilProperties.setSoilProperties();
|
soilProperties.setSoilProperties();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Changes the time required for the crops to be harvestable
|
// Changes the time required for the crops to be harvestable
|
||||||
public void setCropTimer()
|
public void setCropTimer()
|
||||||
{
|
{
|
||||||
@ -84,7 +95,7 @@ class Crops
|
|||||||
{
|
{
|
||||||
return 8;
|
return 8;
|
||||||
}
|
}
|
||||||
else if (Status == 3) //crops
|
else
|
||||||
{
|
{
|
||||||
if (cropType == 0)
|
if (cropType == 0)
|
||||||
{
|
{
|
||||||
@ -103,36 +114,36 @@ class Crops
|
|||||||
return 50; //Fruit Trees
|
return 50; //Fruit Trees
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else //Harvestable Crops
|
|
||||||
{
|
|
||||||
if (cropType == 0)
|
|
||||||
{
|
|
||||||
return 30; //Carrots
|
|
||||||
}
|
}
|
||||||
else if (cropType == 1)
|
|
||||||
|
public void degradeSoil()
|
||||||
{
|
{
|
||||||
return 40; //Wheat
|
|
||||||
}
|
if (soilProperties.Nitrogen > 4.0f)
|
||||||
else if (cropType == 2)
|
|
||||||
{
|
{
|
||||||
return 50; //Berries
|
soilProperties.Nitrogen = soilProperties.Nitrogen - soilProperties.NitrogenDegradeRate;
|
||||||
}
|
}
|
||||||
else
|
if (soilProperties.Phosphorous > 0.1f)
|
||||||
{
|
{
|
||||||
return 100; //Fruit Trees
|
soilProperties.Phosphorous = soilProperties.Phosphorous - soilProperties.PhosphorousDegradeRate;
|
||||||
}
|
}
|
||||||
|
if (soilProperties.Potassium > 0.1f)
|
||||||
|
{
|
||||||
|
soilProperties.Potassium = soilProperties.Potassium - soilProperties.PotassiumDegradeRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setCropType(int Type)
|
public void setCropType(int Type, CropTypes nCropType)
|
||||||
{
|
{
|
||||||
|
DataSet = nCropType;
|
||||||
cropType = Type;
|
cropType = Type;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getStatus()
|
public int getStatus()
|
||||||
{
|
{
|
||||||
if (Status != 4)
|
if (Status != 3)
|
||||||
{
|
{
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
@ -176,6 +187,47 @@ class Crops
|
|||||||
return housePos;
|
return housePos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public float getProductionRate()
|
||||||
|
{
|
||||||
|
if (DataSet != null)
|
||||||
|
{
|
||||||
|
int ProductionRate = 100;
|
||||||
|
ProductionRate = (int)(ProductionRate * compareToDatset(soilProperties.Temperature, DataSet.Temparature));
|
||||||
|
ProductionRate = (int)(ProductionRate * compareToDatset(soilProperties.Moisture , DataSet.Moisture));
|
||||||
|
ProductionRate = (int)(ProductionRate * compareToDatset(soilProperties.Humidity , DataSet.Humidity));
|
||||||
|
ProductionRate = (int)(ProductionRate * compareToDatset(soilProperties.Phosphorous , DataSet.Phosphorous));
|
||||||
|
ProductionRate = (int)(ProductionRate * compareToDatset(soilProperties.Potassium , DataSet.Potassium));
|
||||||
|
ProductionRate = (int)(ProductionRate * compareToDatset(soilProperties.Nitrogen , DataSet.Nitrogen));
|
||||||
|
if (ProductionRate < 0)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return ProductionRate;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public float compareToDatset(float i, float j)
|
||||||
|
{
|
||||||
|
if (i < j)
|
||||||
|
{
|
||||||
|
return (i / j) * 0.2f;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return i / j;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void Inspect(int tileSize, int Spacing, SpriteFont Bold, SpriteBatch spriteBatch, string[] cropTypesNames)
|
public void Inspect(int tileSize, int Spacing, SpriteFont Bold, SpriteBatch spriteBatch, string[] cropTypesNames)
|
||||||
{
|
{
|
||||||
spriteBatch.Begin();
|
spriteBatch.Begin();
|
||||||
@ -196,17 +248,13 @@ class Crops
|
|||||||
spriteBatch.DrawString(Bold, "Tiletype: Soil", new Vector2(240, Size.Y * (tileSize + Spacing) + 42), Color.DarkBlue);
|
spriteBatch.DrawString(Bold, "Tiletype: Soil", new Vector2(240, Size.Y * (tileSize + Spacing) + 42), Color.DarkBlue);
|
||||||
}
|
}
|
||||||
else if (Status == 3)
|
else if (Status == 3)
|
||||||
{
|
|
||||||
spriteBatch.DrawString(Bold, "Tiletype: Planted", new Vector2(240, Size.Y * (tileSize + Spacing) + 42), Color.DarkBlue);
|
|
||||||
}
|
|
||||||
else if (Status == 4)
|
|
||||||
{
|
{
|
||||||
int x = (int)(((float)Timer / fullTimer) * 100);
|
int x = (int)(((float)Timer / fullTimer) * 100);
|
||||||
x = 100 - x;
|
x = 100 - x;
|
||||||
spriteBatch.DrawString(Bold, "Tiletype: Crop ", new Vector2(240, Size.Y * (tileSize + Spacing) + 42), Color.DarkBlue);
|
spriteBatch.DrawString(Bold, "Tiletype: Crop ", new Vector2(240, Size.Y * (tileSize + Spacing) + 42), Color.DarkBlue);
|
||||||
spriteBatch.DrawString(Bold, "Completion: " + x + "%", new Vector2(240, Size.Y * (tileSize + Spacing) + 82), Color.DarkBlue);
|
spriteBatch.DrawString(Bold, "Completion: " + x + "%", new Vector2(240, Size.Y * (tileSize + Spacing) + 82), Color.DarkBlue);
|
||||||
}
|
}
|
||||||
if (Status != 4)
|
if (Status != 3)
|
||||||
{
|
{
|
||||||
spriteBatch.DrawString(Bold, "-------------", new Vector2(240, Size.Y * (tileSize + Spacing) + 82), Color.DarkRed);
|
spriteBatch.DrawString(Bold, "-------------", new Vector2(240, Size.Y * (tileSize + Spacing) + 82), Color.DarkRed);
|
||||||
}
|
}
|
||||||
@ -219,13 +267,22 @@ class Crops
|
|||||||
spriteBatch.DrawString(Bold, "None", new Vector2(240, Size.Y * (tileSize + Spacing) + 62), Color.DarkBlue);
|
spriteBatch.DrawString(Bold, "None", new Vector2(240, Size.Y * (tileSize + Spacing) + 62), Color.DarkBlue);
|
||||||
}
|
}
|
||||||
spriteBatch.DrawString(Bold, "Soil Properties:", new Vector2(240, Size.Y * (tileSize + Spacing) + 122), Color.DarkRed);
|
spriteBatch.DrawString(Bold, "Soil Properties:", new Vector2(240, Size.Y * (tileSize + Spacing) + 122), Color.DarkRed);
|
||||||
spriteBatch.DrawString(Bold, "Soil Type: " + soilProperties.soilType, new Vector2(240, Size.Y * (tileSize + Spacing) + 142), Color.DarkBlue);
|
spriteBatch.DrawString(Bold, "Soil Type: ", new Vector2(240, Size.Y * (tileSize + Spacing) + 142), Color.DarkRed);
|
||||||
spriteBatch.DrawString(Bold, "Temparature: " + soilProperties.Temparature, new Vector2(240, Size.Y * (tileSize + Spacing) + 162), Color.DarkBlue);
|
spriteBatch.DrawString(Bold, soilProperties.soilType, new Vector2(370, Size.Y * (tileSize + Spacing) + 142), Color.DarkBlue);
|
||||||
spriteBatch.DrawString(Bold, "Moisture: " + soilProperties.Moisture, new Vector2(240, Size.Y * (tileSize + Spacing) + 182), Color.DarkBlue);
|
spriteBatch.DrawString(Bold, "Temparature: ", new Vector2(240, Size.Y * (tileSize + Spacing) + 162), Color.DarkRed);
|
||||||
spriteBatch.DrawString(Bold, "Humidity: " + soilProperties.Humidity, new Vector2(240, Size.Y * (tileSize + Spacing) + 202), Color.DarkBlue);
|
spriteBatch.DrawString(Bold, soilProperties.Temperature.ToString(), new Vector2(370, Size.Y * (tileSize + Spacing) + 162), Color.DarkBlue);
|
||||||
spriteBatch.DrawString(Bold, "Phosphorous: " + soilProperties.Phosphorous, new Vector2(240, Size.Y * (tileSize + Spacing) + 222), Color.DarkBlue);
|
spriteBatch.DrawString(Bold, "Moisture: ", new Vector2(240, Size.Y * (tileSize + Spacing) + 182), Color.DarkRed);
|
||||||
spriteBatch.DrawString(Bold, "Potassium: " + soilProperties.Potassium, new Vector2(240, Size.Y * (tileSize + Spacing) + 242), Color.DarkBlue);
|
spriteBatch.DrawString(Bold, soilProperties.Moisture.ToString(), new Vector2(370, Size.Y * (tileSize + Spacing) + 182), Color.DarkBlue);
|
||||||
spriteBatch.DrawString(Bold, "Nitrogen: " + soilProperties.Nitrogen, new Vector2(240, Size.Y * (tileSize + Spacing) + 262), Color.DarkBlue);
|
spriteBatch.DrawString(Bold, "Humidity: ", new Vector2(240, Size.Y * (tileSize + Spacing) + 202), Color.DarkRed);
|
||||||
|
spriteBatch.DrawString(Bold, soilProperties.Humidity.ToString(), new Vector2(370, Size.Y * (tileSize + Spacing) + 202), Color.DarkBlue);
|
||||||
|
spriteBatch.DrawString(Bold, "Phosphorous: ", new Vector2(240, Size.Y * (tileSize + Spacing) + 222), Color.DarkRed);
|
||||||
|
spriteBatch.DrawString(Bold, soilProperties.Phosphorous.ToString(), new Vector2(370, Size.Y * (tileSize + Spacing) + 222), Color.DarkBlue);
|
||||||
|
spriteBatch.DrawString(Bold, "Potassium: ", new Vector2(240, Size.Y * (tileSize + Spacing) + 242), Color.DarkRed);
|
||||||
|
spriteBatch.DrawString(Bold, soilProperties.Potassium.ToString(), new Vector2(370, Size.Y * (tileSize + Spacing) + 242), Color.DarkBlue);
|
||||||
|
spriteBatch.DrawString(Bold, "Nitrogen: ", new Vector2(240, Size.Y * (tileSize + Spacing) + 262), Color.DarkRed);
|
||||||
|
spriteBatch.DrawString(Bold, soilProperties.Nitrogen.ToString(), new Vector2(370, Size.Y * (tileSize + Spacing) + 262), Color.DarkBlue);
|
||||||
|
spriteBatch.DrawString(Bold, "Production Rate: ", new Vector2(240, Size.Y * (tileSize + Spacing) + 282), Color.DarkRed);
|
||||||
|
spriteBatch.DrawString(Bold, getProductionRate().ToString(), new Vector2(370, Size.Y * (tileSize + Spacing) + 282), Color.DarkBlue);
|
||||||
spriteBatch.End();
|
spriteBatch.End();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,8 @@ class Farm
|
|||||||
crops[i, j] = new Crops();
|
crops[i, j] = new Crops();
|
||||||
crops[i, j].setStatus(x);
|
crops[i, j].setStatus(x);
|
||||||
crops[i, j].setOriginalStatus();
|
crops[i, j].setOriginalStatus();
|
||||||
crops[i, j].setCropType(x = r.Next(0, 4));
|
x = r.Next(0, 11);
|
||||||
|
crops[i, j].setCropType(x, PresetCrops.getPresetCropTypes(x));
|
||||||
crops[i, j].init();
|
crops[i, j].init();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -58,7 +59,7 @@ class Farm
|
|||||||
{
|
{
|
||||||
int x = (int)xfloat;
|
int x = (int)xfloat;
|
||||||
int y = (int)yfloat;
|
int y = (int)yfloat;
|
||||||
if (crops[x, y].getStatus() >= 4)
|
if (crops[x, y].getStatus() >= 3)
|
||||||
{
|
{
|
||||||
crops[x, y].setStatus(2);
|
crops[x, y].setStatus(2);
|
||||||
}
|
}
|
||||||
@ -69,10 +70,6 @@ class Farm
|
|||||||
else if (crops[x, y].getStatus() == 2)
|
else if (crops[x, y].getStatus() == 2)
|
||||||
{
|
{
|
||||||
crops[x, y].setStatus(3);
|
crops[x, y].setStatus(3);
|
||||||
}
|
|
||||||
else if (crops[x, y].getStatus() == 3)
|
|
||||||
{
|
|
||||||
crops[x, y].setStatus(4);
|
|
||||||
crops[x, y].setCropTimer();
|
crops[x, y].setCropTimer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,12 +11,15 @@ class SoilProperties
|
|||||||
|
|
||||||
|
|
||||||
public string soilType = "potato";
|
public string soilType = "potato";
|
||||||
public float Temparature;
|
public float Temperature;
|
||||||
public float Humidity;
|
public float Humidity;
|
||||||
public float Moisture;
|
public float Moisture;
|
||||||
public float Nitrogen;
|
public float Nitrogen;
|
||||||
public float Potassium;
|
public float Potassium;
|
||||||
public float Phosphorous;
|
public float Phosphorous;
|
||||||
|
public float NitrogenDegradeRate = 0.001f;
|
||||||
|
public float PotassiumDegradeRate = 0.001f;
|
||||||
|
public float PhosphorousDegradeRate = 0.001f;
|
||||||
|
|
||||||
public void setSoilProperties()
|
public void setSoilProperties()
|
||||||
{
|
{
|
||||||
@ -41,8 +44,8 @@ class SoilProperties
|
|||||||
{
|
{
|
||||||
soilType = "Clayey";
|
soilType = "Clayey";
|
||||||
}
|
}
|
||||||
Temparature = GetRandomNumber(22, 30);
|
Temperature = GetRandomNumber(22, 30);
|
||||||
Humidity = Temparature * 2 + GetRandomNumber(1.9, 2.2);
|
Humidity = Temperature * GetRandomNumber(1.9, 2.1);
|
||||||
Moisture = GetRandomNumber(20, 70);
|
Moisture = GetRandomNumber(20, 70);
|
||||||
Nitrogen = GetRandomNumber(4 , 55);
|
Nitrogen = GetRandomNumber(4 , 55);
|
||||||
Potassium = GetRandomNumber(0, 28);
|
Potassium = GetRandomNumber(0, 28);
|
||||||
|
@ -12,7 +12,7 @@ class DayNightCycle
|
|||||||
private int dayTime = 0;
|
private int dayTime = 0;
|
||||||
private int lengthOfDay = 20000;
|
private int lengthOfDay = 20000;
|
||||||
private int lengthOfNight = 20000;
|
private int lengthOfNight = 20000;
|
||||||
private int Days;
|
private int Days = 1;
|
||||||
|
|
||||||
public void updateTime(int Speed)
|
public void updateTime(int Speed)
|
||||||
{
|
{
|
||||||
|