コード例 #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);
            }
        }
コード例 #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;
        }
コード例 #3
0
 public ClassHierophant UpdateHierophant(ClassHierophant newHero)
 {
     try
     {
         if (newHero != null)
         {
             ClassHierophant oldHero = hierophant;
             hierophant = newHero;
             return(oldHero);
         }
         throw new Exception("New captain is not valid!");
     }
     catch (Exception ex)
     {
         lastErr = ex.Message;
         throw ex;
     }
 }