Esempio n. 1
0
        static void Main(string[] args)
        {
            Adam   adam_clientSide   = new Adam();
            Aarti  aarti_clientSide  = new Aarti();
            Tamela tamela_clientSide = new Tamela();
            Jason  jason_serverSide  = new Jason();
            Ryan   ryan_serverSide   = new Ryan();
            Eliza  eliza_serverSide  = new Eliza();

            Console.WriteLine("CLIENT SIDE:");
            List <ITeamMember> clientSide = new List <ITeamMember>();

            clientSide.Add(adam_clientSide);
            clientSide.Add(aarti_clientSide);
            clientSide.Add(tamela_clientSide);
            foreach (var x in clientSide)
            {
                Console.WriteLine(x.fullName);
                x.work();
            }

            Console.WriteLine("");
            List <ITeamMember> serverSide = new List <ITeamMember>();

            serverSide.Add(jason_serverSide);
            serverSide.Add(ryan_serverSide);
            serverSide.Add(eliza_serverSide);

            Console.WriteLine("SERVER SIDE:");
            foreach (var x in serverSide)
            {
                Console.WriteLine(x.fullName);
                x.work();
            }
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            /*
             * Create two groups (i.e. List) that will hold three teammates each.
             * These two lists represent one team that will be the server side team,
             * and one that will be the client side team
             */
            List <IClassmate> serverSide = new List <IClassmate>();
            List <IClassmate> clientSide = new List <IClassmate>();

            //Instantiate one instance of each of your teammates.
            Jason  jason  = new Jason();
            Jordan jordan = new Jordan();
            Adam   adam   = new Adam();
            Ryan   ryan   = new Ryan();
            Ollie  ollie  = new Ollie();
            Aarti  aarti  = new Aarti();

            serverSide.Add(jason);
            serverSide.Add(aarti);
            serverSide.Add(adam);
            clientSide.Add(ryan);
            clientSide.Add(ollie);
            clientSide.Add(jordan);

            foreach (var s in serverSide)
            {
                s.Work();
            }

            foreach (var c1 in clientSide)
            {
                c1.Work();
            }
        }