the humans in the borders are now also processed
This commit is contained in:
@@ -119,6 +119,118 @@ namespace PropagationRemasteredBeta
|
||||
|
||||
//check bottom right
|
||||
peopleToCheckLocations.Add(new Point(Position.X + 1, Position.Y - 1));
|
||||
}
|
||||
else
|
||||
{
|
||||
//now we have te peoples that are in sides or corners
|
||||
|
||||
if (Position.Y == 0)
|
||||
{
|
||||
if (Position.X == 0)
|
||||
{
|
||||
//top left corner
|
||||
// @#
|
||||
// ##
|
||||
peopleToCheckLocations.Add(new Point(Position.X + 1,Position.Y));
|
||||
peopleToCheckLocations.Add(new Point(Position.X, Position.Y + 1));
|
||||
peopleToCheckLocations.Add(new Point(Position.X + 1, Position.Y + 1));
|
||||
}
|
||||
else if (Position.X >= T.TerrainSize.Width -1)
|
||||
{
|
||||
//top right corner
|
||||
// #@
|
||||
// ##
|
||||
peopleToCheckLocations.Add(new Point(Position.X - 1, Position.Y + 1));
|
||||
peopleToCheckLocations.Add(new Point(Position.X - 1, Position.Y));
|
||||
peopleToCheckLocations.Add(new Point(Position.X, Position.Y + 1));
|
||||
}
|
||||
else
|
||||
{
|
||||
//on the top side
|
||||
// #@#
|
||||
// ###
|
||||
peopleToCheckLocations.Add(new Point(Position.X - 1, Position.Y + 1));
|
||||
peopleToCheckLocations.Add(new Point(Position.X - 1, Position.Y));
|
||||
peopleToCheckLocations.Add(new Point(Position.X + 1, Position.Y));
|
||||
peopleToCheckLocations.Add(new Point(Position.X, Position.Y + 1));
|
||||
peopleToCheckLocations.Add(new Point(Position.X + 1, Position.Y + 1));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Position.Y >= T.TerrainSize.Height - 1)
|
||||
{
|
||||
if (Position.X == 0)
|
||||
{
|
||||
//bottom left corner
|
||||
// ##
|
||||
// @#
|
||||
peopleToCheckLocations.Add(new Point(Position.X + 1, Position.Y));
|
||||
peopleToCheckLocations.Add(new Point(Position.X, Position.Y - 1));
|
||||
peopleToCheckLocations.Add(new Point(Position.X + 1, Position.Y - 1));
|
||||
}
|
||||
else if (Position.X >= T.TerrainSize.Width - 1)
|
||||
{
|
||||
//Bottom right corner
|
||||
// ##
|
||||
// #@
|
||||
peopleToCheckLocations.Add(new Point(Position.X - 1, Position.Y - 1));
|
||||
peopleToCheckLocations.Add(new Point(Position.X - 1, Position.Y));
|
||||
peopleToCheckLocations.Add(new Point(Position.X, Position.Y - 1));
|
||||
}
|
||||
else
|
||||
{
|
||||
//on the bottom side
|
||||
// ###
|
||||
// #@#
|
||||
peopleToCheckLocations.Add(new Point(Position.X - 1, Position.Y - 1));
|
||||
peopleToCheckLocations.Add(new Point(Position.X - 1, Position.Y));
|
||||
peopleToCheckLocations.Add(new Point(Position.X + 1, Position.Y));
|
||||
peopleToCheckLocations.Add(new Point(Position.X, Position.Y - 1));
|
||||
peopleToCheckLocations.Add(new Point(Position.X + 1, Position.Y - 1));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//on the left side
|
||||
if (Position.X >= T.TerrainSize.Width -1)
|
||||
{
|
||||
// ##
|
||||
// #@
|
||||
// ##
|
||||
peopleToCheckLocations.Add(new Point(Position.X,Position.Y));
|
||||
|
||||
peopleToCheckLocations.Add(new Point(Position.X -1, Position.Y -1));
|
||||
peopleToCheckLocations.Add(new Point(Position.X, Position.Y -1));
|
||||
peopleToCheckLocations.Add(new Point(Position.X -1, Position.Y));
|
||||
peopleToCheckLocations.Add(new Point(Position.X - 1, Position.Y +1));
|
||||
peopleToCheckLocations.Add(new Point(Position.X, Position.Y +1));
|
||||
}
|
||||
else
|
||||
{
|
||||
//on the right side
|
||||
// ##
|
||||
// @#
|
||||
// ##
|
||||
peopleToCheckLocations.Add(new Point(Position.X, Position.Y));
|
||||
|
||||
peopleToCheckLocations.Add(new Point(Position.X, Position.Y -1));
|
||||
peopleToCheckLocations.Add(new Point(Position.X + 1, Position.Y -1));
|
||||
peopleToCheckLocations.Add(new Point(Position.X + 1, Position.Y));
|
||||
peopleToCheckLocations.Add(new Point(Position.X, Position.Y + 1));
|
||||
peopleToCheckLocations.Add(new Point(Position.X + 1, Position.Y + 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
foreach (Point p in peopleToCheckLocations)
|
||||
{
|
||||
@@ -129,7 +241,6 @@ namespace PropagationRemasteredBeta
|
||||
}
|
||||
}
|
||||
T.InfectedsToCheck.Add(this);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
public Human CheckInfection(int infectiosity, Random rnd)
|
||||
|
||||
@@ -126,6 +126,9 @@ namespace PropagationRemasteredBeta
|
||||
//this.Invalidate();
|
||||
|
||||
BufferImage = t.Display();
|
||||
|
||||
tmrTick.Start();
|
||||
|
||||
pbxTerrain.Image = BufferImage;
|
||||
stopwatch.Stop();
|
||||
totalTime = stopwatch.ElapsedMilliseconds;
|
||||
@@ -137,12 +140,10 @@ namespace PropagationRemasteredBeta
|
||||
//refresh all the stats
|
||||
lblMemory.Text = GetMemoryUsage().ToString() + " Mb";
|
||||
lblelementsCounter.Text = t.DRAWED_ELEMENTS.ToString();
|
||||
lblInfected.Text = t.InfectedCount[t.InfectedCount.Count() - 1].ToString();
|
||||
lblImmunes.Text = t.ImmuneCount[t.ImmuneCount.Count() - 1].ToString();
|
||||
lblSain.Text = t.SainCount[t.SainCount.Count() - 1].ToString();
|
||||
lblDeaths.Text = t.DeadCount[t.DeadCount.Count() - 1].ToString();
|
||||
|
||||
tmrTick.Start();
|
||||
//lblInfected.Text = t.InfectedCount[t.InfectedCount.Count() - 1].ToString();
|
||||
//lblImmunes.Text = t.ImmuneCount[t.ImmuneCount.Count() - 1].ToString();
|
||||
//lblSain.Text = t.SainCount[t.SainCount.Count() - 1].ToString();
|
||||
//lblDeaths.Text = t.DeadCount[t.DeadCount.Count() - 1].ToString();
|
||||
}
|
||||
|
||||
private double GetMemoryUsage()
|
||||
|
||||
Reference in New Issue
Block a user