Esempio n. 1
0
		public GameHandler (UIt uit, Controller ctrll)
		{
			ctrl = ctrll;
			ui = uit;
			playerList.Add (new HumanPlayer ());
			playerList.Add (new AiPlayer ());
		}
Esempio n. 2
0
		/// <summary>
		/// Allows the game to perform any initialization it needs to before starting to run.
		/// This is where it can query for any required services and load any non-graphic
		/// related content.  Calling base.Initialize will enumerate through any components
		/// and initialize them as well.
		/// </summary>
		protected override void Initialize ()
		{
			// TODO: Add your initialization logic here
			ui = new UIt();
			base.Initialize ();	
			handler = new GameHandler (ui, ui.GetController());
		}
Esempio n. 3
0
 public GameHandler(UIt uit, Controller ctrll)
 {
     ctrl = ctrll;
     ui   = uit;
     playerList.Add(new HumanPlayer());
     playerList.Add(new AiPlayer());
 }
Esempio n. 4
0
 /// <summary>
 /// Allows the game to perform any initialization it needs to before starting to run.
 /// This is where it can query for any required services and load any non-graphic
 /// related content.  Calling base.Initialize will enumerate through any components
 /// and initialize them as well.
 /// </summary>
 protected override void Initialize()
 {
     // TODO: Add your initialization logic here
     ui = new UIt();
     base.Initialize();
     handler = new GameHandler(ui, ui.GetController());
 }
Esempio n. 5
0
		public override int Play(UIt ui)
		{
			MouseState newState = Mouse.GetState();

			if (newState.LeftButton == ButtonState.Pressed && oldState.LeftButton == ButtonState.Released)
			{
				pressing = true;
			}

			if (newState.LeftButton == ButtonState.Released && oldState.LeftButton == ButtonState.Pressed && pressing)
			{
				pressing = false;
				int mx = newState.Position.X;
				int my = newState.Position.Y;
				return ui.ClickScreen (mx, my);
			}

			oldState = newState; // this reassigns the old state so that it is ready for next time
			return 0;
		}
Esempio n. 6
0
        public override int Play(UIt ui)
        {
            uit = ui;
            vertCords.Clear();
            vertResults.Clear();
            horCords.Clear();
            horResults.Clear();
            horDone.Clear();
            vertDone.Clear();

            if (playwordchangeturn())
            {
                return(1);
            }
            else
            {
                uit.ThrowLettersPressed();
                return(1);
            }
        }
Esempio n. 7
0
        public override int Play(UIt ui)
        {
            MouseState newState = Mouse.GetState();

            if (newState.LeftButton == ButtonState.Pressed && oldState.LeftButton == ButtonState.Released)
            {
                pressing = true;
            }

            if (newState.LeftButton == ButtonState.Released && oldState.LeftButton == ButtonState.Pressed && pressing)
            {
                pressing = false;
                int mx = newState.Position.X;
                int my = newState.Position.Y;
                return(ui.ClickScreen(mx, my));
            }

            oldState = newState;             // this reassigns the old state so that it is ready for next time
            return(0);
        }
Esempio n. 8
0
		public abstract int Play(UIt ui);
Esempio n. 9
0
 public abstract int Play(UIt ui);