Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using ClashOfKings.Contracts;
- using ClashOfKings.Models.Armies;
- namespace ClashOfKings.Models.Cities
- {
- public abstract class City : ICity
- {
- private string name;
- private CityType cityType;
- private IHouse controllingHouse;
- private decimal upgradeCost;
- private int defense;
- private decimal taxBase;
- private IEnumerable<IMilitaryUnit> availableMilitaryUnits = new List<IMilitaryUnit>();
- private Dictionary<UnitType, int> availableUnitsByType;
- private IEnumerable<IArmyStructure> armyStructures = new List<IArmyStructure>();
- private double foodProduction;
- private double foodStorage;
- public City(
- string name,
- CityType cityType,
- IHouse controllingHouse,
- decimal upgradeCost,
- int defense,
- decimal taxBase,
- IEnumerable<IMilitaryUnit> availableMilitaryUnits,
- Dictionary<UnitType, int> availableUnitsByType,
- IEnumerable<IArmyStructure> armyStructures,
- double foodProduction,
- double foodStorage)
- {
- this.Name = name;
- this.CityType = cityType;
- this.ControllingHouse = controllingHouse;
- this.UpgradeCost = upgradeCost;
- this.Defense = defense;
- this.TaxBase = taxBase;
- this.AvailableUnitsByType = new Dictionary<UnitType, int>();
- this.FoodProduction = foodProduction;
- this.FoodStorage = foodStorage;
- }
- public string Name
- {
- get
- {
- return this.name;
- }
- set
- {
- if (string.IsNullOrWhiteSpace(value))
- {
- throw new ArgumentNullException("The name of the city cannot be null");
- }
- this.name = value;
- }
- }
- public CityType CityType { get; set; }
- public IHouse ControllingHouse { get; set; }
- public decimal UpgradeCost
- {
- get
- {
- return this.upgradeCost;
- }
- set
- {
- if (value < 0)
- {
- throw new ArgumentNullException("The upgrade cost cannot be negative");
- }
- this.upgradeCost = value;
- }
- }
- public int Defense
- {
- get
- {
- return this.defense;
- }
- set
- {
- if (value < 0)
- {
- throw new ArgumentNullException("The defense cannot be negative");
- }
- this.defense = value;
- }
- }
- public decimal TaxBase
- {
- get
- {
- return this.taxBase;
- }
- set
- {
- if (value < 0)
- {
- throw new ArgumentNullException("The tax base cost cannot be negative");
- }
- this.taxBase = value;
- }
- }
- public IEnumerable<IMilitaryUnit> AvailableMilitaryUnits
- {
- get { return this.availableMilitaryUnits; }
- }
- public Dictionary<UnitType, int> AvailableUnitsByType { get; }
- public IEnumerable<IArmyStructure> ArmyStructures
- {
- get { return this.armyStructures; }
- }
- public double FoodProduction
- {
- get
- {
- return this.foodProduction;
- }
- set
- {
- if (value < 0)
- {
- throw new ArgumentNullException("The food production cannot be negative");
- }
- this.foodProduction = value;
- }
- }
- public double FoodStorage
- {
- get
- {
- return this.foodStorage;
- }
- set
- {
- if (value < 0)
- {
- throw new ArgumentNullException("The food storage cannot be negative");
- }
- this.foodStorage = value;
- }
- }
- public void Upgrade()
- {
- throw new NotImplementedException();
- }
- public void Downgrade()
- {
- throw new NotImplementedException();
- }
- public int AvailableUnitCapacity(UnitType type)
- {
- throw new NotImplementedException();
- }
- public void AddUnits(ICollection<IMilitaryUnit> units)
- {
- this.availableMilitaryUnits.Concat(units);
- }
- public ICollection<IMilitaryUnit> RemoveUnits()
- {
- throw new NotImplementedException();
- }
- public void AddArmyStructure(IArmyStructure structure)
- {
- throw new NotImplementedException();
- }
- public void Update()
- {
- throw new NotImplementedException();
- }
- public string Print()
- {
- throw new NotImplementedException();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement