Esempio n. 1
0
        public bool AddNewBoat(string _boatName, BoatType _type)
        {
            BoatStats _newBoatStats = new BoatStats(_type);

            _boatName += (" " + TroopUtility.IntToRomanNumeral(AddNameToDatabase(_boatName)));
            _newBoatStats.boatName = _boatName;
            boats.Add(_newBoatStats);
            return(true);
        }
Esempio n. 2
0
        public BoatStats(BoatType _type)
        {
            BoatStats _newStats = GetStatsForType(_type);

            boatName      = _newStats.boatName;
            boatType      = _newStats.boatType;
            troopCapacity = _newStats.troopCapacity;
            lootCapasity  = _newStats.lootCapasity;
            knots         = _newStats.knots;
            health        = _newStats.health;
            sprite        = Resources.Load <Sprite>(_type.ToString());
        }
Esempio n. 3
0
 public bool RemoveBoat(BoatStats _boatToRemove)
 {
     if (boats.Count > 1)
     {
         boats.Remove(_boatToRemove);
         return(true);
     }
     else
     {
         return(false);
     }
 }
Esempio n. 4
0
        public BoatStats GetStatsForType(BoatType _type)
        {
            BoatStats _newStats = null;

            switch (_type)
            {
            case BoatType.TestBoat:
                _newStats = new BoatStats("NewTestboat", BoatType.TestBoat, 10, 10, 10, 100);
                break;
            }

            if (_newStats != null)
            {
                return(_newStats);
            }
            else
            {
                Debug.LogError("Requested Boattype not setup in the GetStatsForType method!");
                return(null);
            }
        }
Esempio n. 5
0
 public bool RemoveBoatByName(string _boatToRemove)
 {
     if (boats.Count > 1)
     {
         BoatStats _removed = null;
         foreach (BoatStats bs in boats)
         {
             if (bs.boatName == _boatToRemove)
             {
                 _removed = bs;
                 boats.Remove(bs);
                 break;
             }
         }
         return(true);
     }
     else
     {
         return(false);
     }
 }