public Building(Game game, Node node, Graph graph, AIAgent agent, Color renderColor) : base(game) { this.graph = graph; this.renderColor = renderColor; this.game = game; Position = node.Position * Game1.graphSize; Position = new Vector2(Position.X + 16, Position.Y + 16); healthText = new TextRepresentation(game, new Vector2(Position.X, Position.Y - 8)); game.Components.Add(healthText); LoadContent(); }
public GoldMine(Game game, Node node, Graph graph, AIAgent agent) :base (game, node, graph, agent, Color.White) { spriteName = "goldMine"; this.node = node; this.node.IsBlocked = true; this.Position = node.Position * Game1.graphSize; this.Position = new Vector2(Position.X + 16, Position.Y + 16); resourceRemaining = maxResource; goldText = new TextRepresentation(game, Position); game.Components.Add(goldText); }
public GoldMine(Game game, Node node, Graph graph, AIAgent agent) : base(game, node, graph, agent, Color.White) { spriteName = "goldMine"; this.node = node; this.node.IsBlocked = true; this.Position = node.Position * Game1.graphSize; this.Position = new Vector2(Position.X + 16, Position.Y + 16); resourceRemaining = maxResource; goldText = new TextRepresentation(game, Position); game.Components.Add(goldText); }
public Peon(Game game, Vector2 position, Graph graph, AIAgent agent) : base(game, graph, agent, agent.RenderColor) { spriteName = "peon"; speed = 1f; maxSpeed = 1f; maxAccel = .07f; stopRadius = 2f; slowRadius = 5f; this.position = position; graph.SetNodeBlocked(position); goldText = new TextRepresentation(game, position); Game.Components.Add(goldText); }
public Soldier(Game game, Vector2 position, Graph graph, AIAgent agent) : base(game, graph, agent, agent.RenderColor) { spriteName = "Marine"; maxHealth = 100; health = maxHealth; speed = 1.5f; maxSpeed = 1.5f; maxAccel = .07f; stopRadius = 2f; slowRadius = 5f; this.position = position; graph.SetNodeBlocked(position); healthText = new TextRepresentation(game, position); game.Components.Add(healthText); }
public AIAgent(Game game, Node location, Graph graph, List<GoldMine> goldMines, Color renderColor) : base(game) { this.renderColor = renderColor; Base myBase = new Base((Game1)game, location, graph, this); game.Components.Add(myBase); units = new Units(); buildings = new Buildings(); buildings.GetBase = myBase; buildings.GetGoldMines = goldMines; goldText = new TextRepresentation(game, new Vector2(buildings.GetBase.Position.X, buildings.GetBase.Position.Y + 8)); Game.Components.Add(goldText); this.goldMines = goldMines; foreach (GoldMine mine in goldMines) { if (Vector2.Distance(mine.Position, buildings.GetBase.Position) < distanceToNearestGoldMine) { distanceToNearestGoldMine = Vector2.Distance(mine.Position, buildings.GetBase.Position); buildings.NearestGoldMine = mine; } } }
public AIAgent(Game game, Node location, Graph graph, List <GoldMine> goldMines, Color renderColor) : base(game) { this.renderColor = renderColor; Base myBase = new Base((Game1)game, location, graph, this); game.Components.Add(myBase); units = new Units(); buildings = new Buildings(); buildings.GetBase = myBase; buildings.GetGoldMines = goldMines; goldText = new TextRepresentation(game, new Vector2(buildings.GetBase.Position.X, buildings.GetBase.Position.Y + 8)); Game.Components.Add(goldText); this.goldMines = goldMines; foreach (GoldMine mine in goldMines) { if (Vector2.Distance(mine.Position, buildings.GetBase.Position) < distanceToNearestGoldMine) { distanceToNearestGoldMine = Vector2.Distance(mine.Position, buildings.GetBase.Position); buildings.NearestGoldMine = mine; } } }