Example #1
0
        public Dictionary <int, Duel_Team> Teams;       // Declares the dictionary to keep track of all the teams involved in the duel

        public Duel(PlayerMobile starter)               // The constructor for Duel, initializes required variables
        {
            Caller = starter;                           // sets the caller
            Teams  = new Dictionary <int, Duel_Team>(); // initializes the Teams dictionary so it does not = null
            Teams.Add(1, new Duel_Team(1));             // creates & adds two default teams 1 & 2 to the Teams dictionary
            Teams.Add(2, new Duel_Team(2));
            Duel_Team TeamOne = (Duel_Team)Teams[1];    // creates a variable reference to the default team 1

            TeamOne.AddPlayer(starter);                 // adds the callers as the first player to the default team 1
            Duel_Team TeamTwo = (Duel_Team)Teams[2];    // creates a variable reference to the defualt team 2

            TeamTwo.Players.Add("@null");               // installs one empty slot into the default team 2

            InProgress = false;
            IsRematch  = false;
            Ended      = false;
        }