//public Game1.Actions Actions; public Unit(Player owner, Game1.ObjectType type, Tile tile) { this.ID = Identifier.ID; Identifier.ID++; this.Owner = owner; this.Type = type; this.Tile = tile; this.Tile.Entities.Add(this); this.Texture = ("textures//" + Type.ToString() + Owner.ID.ToString()); if (this.Type == Game1.ObjectType.Soldier) { this.AtkDef = 1; this.AttackRange = 1; this.MovementRange = 1; this.Price = 150; this.Discount = 30; if (this.Owner.ClimateCard.ID == Tile.ClimateID && Owner.ID == 0) { this.Price = this.Price - Discount; } } else if (this.Type == Game1.ObjectType.Robot) { this.AtkDef = 2; this.AttackRange = 1; this.MovementRange = 1; this.Price = 300; this.Discount = 60; if (this.Owner.ClimateCard.ID == Tile.ClimateID && Owner.ID == 1) { this.Price = this.Price - Discount; } } else if (this.Type == Game1.ObjectType.Tank) { this.AtkDef = 3; this.AttackRange = 2; this.MovementRange = 1; this.Price = 750; this.Discount = 150; if (this.Owner.ClimateCard.ID == Tile.ClimateID && Owner.ID == 2) { this.Price = this.Price - Discount; } } else if (this.Type == Game1.ObjectType.Boat) { this.AtkDef = 6; this.AttackRange = 0; this.MovementRange = 2; this.Price = 1000; this.Discount = 200; if (this.Owner.ClimateCard.ID == Tile.ClimateID && Owner.ID == 3) { this.Price = this.Price - Discount; } } }
public static void Move(List<Entity> units, Tile Tile) { for (int i = 0; i < units.Count; i++) { units[i].Tile.Entities = new List<Entity>(); units[i].Tile = Tile; Tile.Entities.Add(units[i]); } }
public Barrack(Player owner, Game1.ObjectType type, Tile tile) { this.ID = Identifier.ID; Identifier.ID++; this.Owner = owner; this.Type = type; this.Tile = tile; this.Tile.Entities.Add(this); this.Tile.Traversable = false; this.Texture = ("textures//" + Type.ToString() + Owner.ID.ToString()); this.AtkDef = (this.Type == Game1.ObjectType.Barrack) ? 6 : 25; }
public Tile(ContentManager content, Vector2 pos, int clid) { this.Entities = new List<Entity>(); this.ID = Identifier.ID2; Identifier.ID2++; this.Position = pos; this.ClimateID = clid; this.Traversable = (ClimateID == 0) ? false : true; this.Highlight = content.Load<Texture2D>("textures\\highlight"); this.HighlightAttack = content.Load<Texture2D>("textures\\highlightattack"); this.HighlightCombine = content.Load<Texture2D>("textures\\highlightcombine"); this.HighlightCombineFalse = content.Load<Texture2D>("textures\\highlightcombinefalse"); this.HighlightFalse = content.Load<Texture2D>("textures\\highlightfalse"); this.Area = new Rectangle((int)this.Position.X, (int)this.Position.Y, 40, 40); this.Left = null; this.Right = null; this.Up = null; this.Down = null; }