Ejemplo n.º 1
0
        public InformationUnit(string name, Race race, Faction faction, float hitPoints, int armor, int sight, int movementSpeed,
                               int costGold, int costFood, Util.Buildings produceAt, int buildTime, int damage, int range, Util.Units type, int piercing)
        {
            Name = name;

            Race    = race;
            Faction = faction;

            HitPoints      = hitPoints;
            HitPointsTotal = HitPoints;
            Armor          = armor;
            Sight          = sight;
            MovementSpeed  = movementSpeed;
            Range          = range;

            CostGold  = costGold;
            CostFood  = costFood;
            ProduceAt = produceAt;
            BuildTime = buildTime;

            Damage   = damage;
            Piercing = piercing;

            Type = type;
        }
        public InformationUnit(string name, Race race, Faction faction, float hitPoints, int armor, int sight, int movementSpeed,
                               int costGold, int costFood, Util.Buildings produceAt, int buildTime, int damage, int precision, int range,
                               int spawn, Util.Units type)
        {
            Name = name;

            Race    = race;
            Faction = faction;

            HitPoints      = Math.Min(200, Math.Max(hitPoints, 1));
            HitPointsTotal = HitPoints;
            Armor          = Math.Min(20, Math.Max(armor, 0));
            Sight          = Math.Min(360, Math.Max(sight, 1));
            MovementSpeed  = movementSpeed;
            Range          = range;

            CostGold  = costGold;
            CostFood  = costFood;
            ProduceAt = produceAt;
            BuildTime = buildTime;

            Damage    = Math.Min(20, Math.Max(damage, 0));
            Precision = Math.Min(100, Math.Max(precision, 1));

            Spawn = Math.Min(4, Math.Max(spawn, 0));

            Type = type;
        }
        public BuilderBuildings(Util.Buildings building, Unit builder, ManagerMouse managerMouse, ManagerBuildings managerBuildings, ManagerUnits managerUnits)
        {
            this.builder = builder;

            this.managerMouse     = managerMouse;
            this.managerUnits     = managerUnits;
            this.managerBuildings = managerBuildings;

            this.building = Buildings.Building.Factory(building, managerMouse, managerBuildings.managerMap, managerUnits);
        }
Ejemplo n.º 4
0
        public InformationBuilding(string name, int hitPoints, int costGold, int costFood, Util.Units creates, int buildTime, Util.Buildings type)
        {
            Name = name;

            HitPoints = hitPoints;

            CostGold  = costGold;
            CostFood  = costFood;
            Creates   = creates;
            BuildTime = buildTime;

            Type = type;
        }
Ejemplo n.º 5
0
        public static Building Factory(Util.Buildings type, ManagerMouse managerMouse, ManagerMap managerMap, ManagerUnits managerUnits)
        {
            Building building = null;

            if (type == Util.Buildings.TOWN_HALL)
            {
                building = new Humans.TownHall(0, 0, managerMouse, managerMap, managerUnits);
            }
            else if (type == Util.Buildings.BARRACKS)
            {
                building = new Humans.Barracks(0, 0, managerMouse, managerMap, managerUnits);
            }
            else if (type == Util.Buildings.CHICKEN_FARM)
            {
                building = new Humans.ChickenFarm(0, 0, managerMouse, managerMap, managerUnits);
            }

            return(building);
        }
Ejemplo n.º 6
0
        public static Building Factory(Util.Buildings type, ManagerMouse managerMouse, ManagerMap managerMap, ManagerUnits managerUnits)
        {
            Building building = null;

            switch (type)
            {
            case Util.Buildings.TOWN_HALL:
                building = new Humans.TownHall(0, 0, managerMouse, managerMap, managerUnits);
                break;

            case Util.Buildings.BARRACKS:
                building = new Humans.Barracks(0, 0, managerMouse, managerMap, managerUnits);
                break;

            case Util.Buildings.CHICKEN_FARM:
                building = new Humans.ChickenFarm(0, 0, managerMouse, managerMap, managerUnits);
                break;

            case Util.Buildings.CHURCH:
                building = new Humans.Church(0, 0, managerMouse, managerMap, managerUnits);
                break;

            case Util.Buildings.GREAT_HALL:
                building = new Orcs.GreatHall(0, 0, managerMouse, managerMap, managerUnits);
                break;

            case Util.Buildings.ORC_BARRACKS:
                building = new Orcs.Barracks(0, 0, managerMouse, managerMap, managerUnits);
                break;

            case Util.Buildings.PIG_FARM:
                building = new Orcs.PigFarm(0, 0, managerMouse, managerMap, managerUnits);
                break;

            case Util.Buildings.ALTAR_OF_STORMS:
                building = new Orcs.AltarOfStorms(0, 0, managerMouse, managerMap, managerUnits);
                break;
            }

            return(building);
        }
Ejemplo n.º 7
0
 public GeneUnit(Util.Buildings building, int action)
     : base(action)
 {
     this.building = building;
 }