public void AddAreaInfluence(Troop owner, AreaInfluenceKind kind, int offset, float rate, Troop troop) { if (this.AreaInfluenceList == null) { this.AreaInfluenceList = new List<AreaInfluenceData>(); } AreaInfluenceData item = new AreaInfluenceData(); item.Owner = owner; item.Kind = kind; item.Offset = offset; item.Rate = rate; this.AreaInfluenceList.Add(item); if (troop != null) { item.ApplyAreaInfluence(troop); } }
public void AddAreaInfluence(Troop owner, AreaInfluenceKind kind, int offset, float rate, Troop troop) { if (this.AreaInfluenceList == null) { this.AreaInfluenceList = new List <AreaInfluenceData>(); } AreaInfluenceData item = new AreaInfluenceData(); item.Owner = owner; item.Kind = kind; item.Offset = offset; item.Rate = rate; this.AreaInfluenceList.Add(item); if (troop != null) { item.ApplyAreaInfluence(troop); } }
public void AddPositionAreaInfluence(Troop troop, Point position, AreaInfluenceKind kind, int offset, float rate) { if (!this.PositionOutOfRange(position)) { Troop troopByPositionNoCheck = this.GetTroopByPositionNoCheck(position); this.MapTileData[position.X, position.Y].AddAreaInfluence(troop, kind, offset, rate, troopByPositionNoCheck); } }