Example #1
0
        public ClassSquad()
        {
            stashList  = new List <ClassItem>();
            rosterList = new List <ClassSoldier>();
            memberList = new List <ClassSoldier>();

            Random      rd      = new Random();
            int         result  = rd.Next(0, 100);
            int         spec    = rd.Next(0, 5);
            CaptainSpec capSpec = (CaptainSpec)spec;

            EditSquadInfo("NPC_Team_" + result.ToString(), "Host_" + result.ToString(), capSpec, false);
            captain            = new ClassCaptain();
            captain.specialism = capSpec;
            hierophant         = new ClassHierophant();
            spec = rd.Next(0, 3);
            HeroSpec heroSpec = (HeroSpec)spec;

            hierophant.specialism = heroSpec;
            credit = 500;

            result = rd.Next(1, 8);

            memberList = new List <ClassSoldier>();
            for (int i = 0; i < result; i++)
            {
                ClassSoldier soldier = new ClassSoldier();
                memberList.Add(soldier);
            }
        }
Example #2
0
        public ClassSquad(string newName, string newPlayerName, CaptainSpec newSpec, bool newPublic, CaptainSpec captainSpec, HeroSpec heroSpec)
        {
            if (newName == null || newPlayerName == null)
            {
                throw new Exception("Invalid Parameter!");
            }

            stashList  = new List <ClassItem>();
            rosterList = new List <ClassSoldier>();
            memberList = new List <ClassSoldier>();

            EditSquadInfo(newName, newPlayerName, newSpec, newPublic);
            captain               = new ClassCaptain();
            captain.specialism    = captainSpec;
            hierophant            = new ClassHierophant();
            hierophant.specialism = heroSpec;
            credit = 500;
        }
Example #3
0
 public ClassCaptain UpdateCaptain(ClassCaptain newCaptain)
 {
     try
     {
         if (newCaptain != null)
         {
             ClassCaptain oldCaptain = captain;
             captain = newCaptain;
             return(oldCaptain);
         }
         throw new Exception("New captain is not valid!");
     }
     catch (Exception ex)
     {
         lastErr = ex.Message;
         throw ex;
     }
 }