コード例 #1
0
        static void Main(string[] args)
        {
            // create two lists to hold two teams of 3
            List <ITeammate> serverSide = new List <ITeammate>();
            List <ITeammate> clientSide = new List <ITeammate>();

            // create new instances of each teammate class
            Greg    Greg    = new Greg();
            Krys    Krys    = new Krys();
            Kimmie  Kimmie  = new Kimmie();
            Garrett Garrett = new Garrett();
            Paul    Paul    = new Paul();
            Sean    Sean    = new Sean();

            // add teammates to each of the two lists
            serverSide.Add(Paul);
            serverSide.Add(Garrett);
            serverSide.Add(Sean);

            clientSide.Add(Greg);
            clientSide.Add(Krys);
            clientSide.Add(Kimmie);


            // iterate over the lists and run each teammates work() method
            foreach (ITeammate teammate in serverSide)
            {
                teammate.Work();
            }

            foreach (ITeammate teammate in clientSide)
            {
                teammate.Work();
            }
        }
コード例 #2
0
 void Start()
 {
     Debug.Log("In Start");
     new Sean();
     Debug.Log("In Start");
     Sean.Main();
 }
コード例 #3
0
        public static void SetupMobiles()
        {
            BaseCreature next = new Gareth();

            next.MoveToWorld(new Point3D(2023, 2841, 20), Map.Trammel);
            next.Home      = next.Location;
            next.RangeHome = 5;

            next = new Gareth();
            next.MoveToWorld(new Point3D(2023, 2841, 20), Map.Felucca);
            next.Home      = next.Location;
            next.RangeHome = 5;

            next = new Dierdre();
            next.MoveToWorld(new Point3D(1442, 1600, 20), Map.Felucca);
            next.Home      = next.Location;
            next.RangeHome = 40;

            next = new Jason();
            next.MoveToWorld(new Point3D(610, 2197, 0), Siege.SiegeShard ? Map.Felucca : Map.Trammel);
            next.Home      = next.Location;
            next.RangeHome = 40;

            next = new Kevin();
            next.MoveToWorld(new Point3D(2464, 439, 15), Siege.SiegeShard ? Map.Felucca : Map.Trammel);
            next.Home      = next.Location;
            next.RangeHome = 40;

            next = new Maribel();
            next.MoveToWorld(new Point3D(1443, 1701, 0), Siege.SiegeShard ? Map.Felucca : Map.Trammel);
            next.Home      = next.Location;
            next.RangeHome = 40;

            next = new Nelson();
            next.MoveToWorld(new Point3D(3441, 2623, 36), Siege.SiegeShard ? Map.Felucca : Map.Trammel);
            next.Home      = next.Location;
            next.RangeHome = 40;

            next = new Sean();
            next.MoveToWorld(new Point3D(2442, 471, 15), Map.Felucca);
            next.Home      = next.Location;
            next.RangeHome = 40;

            next = new Walton();
            next.MoveToWorld(new Point3D(610, 2197, 0), Map.Felucca);
            next.Home      = next.Location;
            next.RangeHome = 40;
        }
コード例 #4
0
        private static void Main(string[] args)
        {
            var gfList = new List <Girlfriend>();

            gfList.Add(new Girlfriend("Vicky", "Blonde", "Blue"));
            gfList.Add(new Girlfriend("Liz", "Blonde", "Blue"));
            gfList.Add(new Girlfriend("Sharon", "Blonde", "Blue"));
            var sean = new Sean(24, "Sean");

            foreach (var gf in gfList)
            {
                if (sean.CheckMatch(gf))
                {
                    Console.WriteLine("She is a match");
                }
                else
                {
                    Console.WriteLine("She is not a match");
                }
            }
        }
コード例 #5
0
ファイル: AddSeans.cs プロジェクト: Rajab97/CinemaManagement
 private void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         Sean sean = new Sean()
         {
             FilmId = (int)cmbFilms.SelectedValue,
             HallId = (byte)cmbHalls.SelectedValue,
             Date   = dtpDate.Value.Date,
             Time   = dtpTime.Value.TimeOfDay,
             Price  = Convert.ToDecimal(txtPrice.Text)
         };
         db.Seans.Add(sean);
         db.SaveChanges();
         this.Hide();
         MainForm.Show();
     }
     catch (Exception d)
     {
         MessageBox.Show(d.Message);
         this.Hide();
         MainForm.Show();
     }
 }