Exemplo n.º 1
0
		public GameHandler (UIt uit, Controller ctrll)
		{
			ctrl = ctrll;
			ui = uit;
			playerList.Add (new HumanPlayer ());
			playerList.Add (new AiPlayer ());
		}
Exemplo 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());
		}
Exemplo n.º 3
0
 public GameHandler(UIt uit, Controller ctrll)
 {
     ctrl = ctrll;
     ui   = uit;
     playerList.Add(new HumanPlayer());
     playerList.Add(new AiPlayer());
 }
Exemplo 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());
 }
Exemplo 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;
		}
Exemplo 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);
            }
        }
Exemplo 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);
        }
Exemplo n.º 8
0
		public abstract int Play(UIt ui);
Exemplo n.º 9
0
 public abstract int Play(UIt ui);