public GameHandler (UIt uit, Controller ctrll) { ctrl = ctrll; ui = uit; playerList.Add (new HumanPlayer ()); playerList.Add (new AiPlayer ()); }
/// <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()); }
public GameHandler(UIt uit, Controller ctrll) { ctrl = ctrll; ui = uit; playerList.Add(new HumanPlayer()); playerList.Add(new AiPlayer()); }
/// <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()); }
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; }
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); } }
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); }
public abstract int Play(UIt ui);
public abstract int Play(UIt ui);