public override void PlaceBuilding(Units.Engineer e)
{
this.state = State.Constructing;
this.constructedBy = e;
e.constructing = this;
this.mesh = Game1.GetInstance().map.collisionMap.PlaceBuilding(this.DefineRectangle());
Game1.GetInstance().IsMouseVisible = true;
for( int i = 0; i < p.buildings.Count(); i++){
Building b = p.buildings.ElementAt(i);
if (b != this)
{
if (b.type != Type.Resources && b.type != Type.Sentry)
{
if (b.waypoints.Count() > 0)
{
Point point = b.waypoints.GetLast();
PathfindingProcessor.GetInstance().Push(b, point);
}
}
}
}
if (Game1.GetInstance().IsMultiplayerGame() &&
this.p == Game1.CURRENT_PLAYER)
{
Synchronizer.GetInstance().QueueBuilding(this);
}
p.resources -= Building.GetCost(this.type);
}