public ClientController(IGameController controller) { _controller = controller; var clientProtocol = new ClientProtocol (this); _transport = new ClientTransport (clientProtocol); }
private static void AttachEvents(Engine engine, IGameController gameController) { gameController.OnMoveLeft += (sender, eventInfo) => { engine.MoveMickeyLeft(); }; gameController.OnMoveRight += (sender, eventInfo) => { engine.MoveMickeyRight(); }; gameController.OnMoveUp += (sender, eventInfo) => { engine.MoveMickeyUp(); }; gameController.OnMoveDown += (sender, eventInfo) => { engine.MoveMickeyDown(); }; gameController.ForbiddenKey += (sender, eventInfo) => { throw new ForbiddenKeyException(); }; }
public Environment(IGameController gameController, EventFactory eventFactory) { _gameController = gameController; _eventFactory = eventFactory; _rnd = new Random (DateTime.Now.Millisecond); _ballProbability = 12; }
public void Init(IGameController controller) { _gameController = controller; _gameScoreKeeper.StartGame(); _ship.Activate(); StartNewRound(); }
public GameViewModel(ViewModelMetadata viewModelMetadata) : base(viewModelMetadata) { BackToMainMenuCommand = new RelayCommand(x => OnChangeViewModel(typeof(StartViewModel))); KeyDownCommand = new RelayCommand(HandleKeyDownCommand); FieldHeight = 20; FieldWidth = 20; var test = new IField[FieldHeight, FieldWidth]; for (int x = 0; x < 20; x++) { for (int y = 0; y < 20; y++) { if (x == 10) test[y, x] = new Field() { Background = Brushes.Yellow, X = x, Y = y, }; else test[y, x] = new Field() { Background = Brushes.Brown, X = x, Y = y }; } } Fields = new IField[FieldHeight, FieldWidth]; Fields = test; GameController = new GameController.GameController(Fields, OnPropertyChanged); }
public GameContainer(GameCore core, IGameController controller, Environment environment, bool isServer) { GameCore = core; EventFactory = new EventFactory (GameCore); GameController = controller; Environment = environment; _hasEnvironment = isServer; }
public void SetUp() { this.State = new TestObjects.GameState(); this.Controller = new ClassicGame(); this.Controller.GameState = this.State; this.State.Controller = this.Controller; this.Controller.PreGameStarted(); this.Controller.GameStarted(); }
public ServerController(IGameController controller) { _controller = controller; var serverProtocol = new ServerProtocol (this); _transport = new ServerTransport (serverProtocol); _transport.StartListening (); }
// Constructors public Engine(IVisualizer visualizer, IGameController gameController, GameSpeed gameSpeed = GameSpeed.Slowest) { this.visualizer = visualizer; this.gameController = gameController; this.allObjects = new List<GameObject>(); this.movingObjects = new List<MovingObject>(); this.staticObjects = new List<GameObject>(); this.textObjects = new List<TextObject>(); this.gameSpeed = gameSpeed; }
public GameEngine(IGameController gameController, IGameboardGenerator fieldGenerator, IDetonationPatternFactory detonationFactory) { this.gameController = gameController; int size = this.gameController.GetPlaygroundSizeFromUser(); double minesPercentage = this.DetermineMinesPercentage(); this.board = fieldGenerator.Generate(size, minesPercentage); this.board.SetDetonationFactory(detonationFactory); this.blownMines = 0; }
public ApplicationController( Game game, IGameController gameController, IInputService inputService) { this.game = game; this.gameController = gameController; this.inputService = inputService; var intro = new State<Action<double>>( "Intro", null, delegate { this.introGameState = new IntroGameState(this.game); this.gameStateManager.Push(this.introGameState); }, () => this.gameStateManager.Pop()); var menu = new State<Action<double>>( "Menu", null, delegate { this.menuGameState = new MenuGameState(this.game, this.inputService); this.gameStateManager.Push(this.menuGameState); }, () => this.gameStateManager.Pop()); var gameplay = new State<Action<double>>( "Gameplay", null, delegate { this.gameplayGameState = new GameplayGameState(this.gameController); this.gameStateManager.Push(this.gameplayGameState); }, () => this.gameStateManager.Pop()); var exit = new State<Action<double>>( "Exit", null, () => this.game.Exit(), null); intro.AddTransition(menu, () => this.introGameState.IsTransitionAllowed); menu.AddTransition(gameplay, () => this.menuGameState.IsTransitionAllowed && (string)this.menuGameState.TransitionTag == MenuItems.StartGame); menu.AddTransition(exit, () => this.menuGameState.IsTransitionAllowed && (string)this.menuGameState.TransitionTag == MenuItems.ExitGame); gameplay.AddTransition(menu, () => this.gameplayGameState.IsTransitionAllowed); this.applicationStateMachine = new StateMachine<Action<double>>(intro); //this.applicationStateMachine = new StateMachine<Action<double>>(gameplay); // Skipping intro and menu for faster startup }
/// <summary> /// Inicjalizuje stan gry. /// </summary> /// <param name="settings">Ustawienia gry.</param> public void Initialize(ISingleplayerSettings settings) { this.MainSettings = settings; this.Players = new IPlayer[] { new Player.Player(settings.PlayerA.Name, settings.PlayerA.Nation, 100), new Player.Player(settings.PlayerB.Name, settings.PlayerB.Nation, 100) }; this.PlayerControllers[0] = settings.PlayerA.Controller; this.PlayerControllers[1] = settings.PlayerB.Controller; this.Map = settings.Map; this.Controller = settings.Controller; this.PlayerControllers[0].ShowStatistics = settings.PlayerA.ShowStatistics; this.PlayerControllers[1].ShowStatistics = settings.PlayerB.ShowStatistics; }
public Engine(IGameController gameController, IRenderer renderer, ISpaceUnitFactory spaceUnitFactory, int canvasRows, int canvasColumns) { this.gameController = gameController; this.renderer = renderer; this.spaceUnitFactory = spaceUnitFactory; this.gameObjects = new List<GameObject>(); this.spaceUnits = new List<SpaceUnit>(); this.producedSpaceUnits = new List<SpaceUnit>(); this.healthUi = null; this.scoreUi = null; this.player = null; this.randomGenerator = new Random(); this.lastSpawnedEnemy = DateTime.Now; this.canvasRows = canvasRows; this.canvasCols = canvasColumns; }
public Game() { this.mode = GameMode.MainMenu; this.menuItems = ConsoleUI.MainMenuItems; this.menuItemIndex = 0; this.cursorMoved = false; this.keyboard = new KeyboardController(); this.renderer = new Renderer(ConsoleUI.BufferRows, ConsoleUI.BufferCols, new Coordinate(ConsoleUI.BufferPositionRow, ConsoleUI.BufferPositionCol)); this.spaceUnitFactory = new SpaceUnitFactory(); this.gameLogo = new GameObject(new Coordinate(ConsoleUI.LogoPositionRow, ConsoleUI.LogoPositionCol), ConsoleUI.LogoBody); this.bottomWall = new GameObject(new Coordinate(ConsoleUI.BottomWallPositionRow, ConsoleUI.BottomWallPositionCol), ConsoleUI.BottomWallBody); this.cursor = new GameObject(new Coordinate(ConsoleUI.MainMenuCursorPositionRow, ConsoleUI.MainMenuCursorPositionCol), ConsoleUI.CursorBody); this.mainMenu = new GameObject(new Coordinate(ConsoleUI.MainMenuPositionRow, ConsoleUI.MainMenuPositionCol), ConsoleUI.MainMenuBody); this.controlsMenu = new GameObject(new Coordinate(ConsoleUI.ConstrolsMenuPositionRow, ConsoleUI.ConstrolsMenuPositionCol), ConsoleUI.ControlsMenuBody); this.highScoreMenu = new GameObject(new Coordinate(ConsoleUI.HighScoreMenuPositionRow, ConsoleUI.HighScoreMenuPositionCol), ConsoleUI.HighScoreMenuBody); this.gameOverMenu = new GameObject(new Coordinate(ConsoleUI.GameOverMenuPositionRow, ConsoleUI.GameOverMenuPositionCol), ConsoleUI.GameOverMenuBody); this.hittedHighScore = new GameObject(new Coordinate(ConsoleUI.HittedHighScorePositionRow, ConsoleUI.HittedHighScorePositionCol), ConsoleUI.HittedHighScoreBody); this.highScore = FileManager.ParseHighScore(); this.gameEngine = null; this.player = null; }
/// <summary> /// Initializes a new instance of the MainViewModel class. /// </summary> public MainWindowViewModel( IGameController gameController, IUIVisualizerService uiVisualizerService, Func<IPlayerConfigurationViewModel> playerConfigurationFactory, Func<ICollection<IPlayer>, IGame> gameFactory, Func<IRoundResult, IRoundResultViewModel> roundResultFactory) { Argument.IsNotNull(() => gameController); Argument.IsNotNull(() => uiVisualizerService); Argument.IsNotNull(() => playerConfigurationFactory); Argument.IsNotNull(() => gameFactory); Argument.IsNotNull(() => roundResultFactory); GameController = gameController; _uiVisualizerService = uiVisualizerService; _playerConfigurationFactory = playerConfigurationFactory; _gameFactory = gameFactory; _roundResultFactory = roundResultFactory; ConfigurePlayersCommand = new Command(OnConfigurePlayers, () => !GameController.IsGameStarted); StartRoundCommand = new Command(OnStartRound, () => GameController.IsGameStarted && !GameController.IsPlaying); EndRoundCommand = new Command(OnEndRound, () => GameController.IsGameStarted && GameController.IsPlaying); }
public FatigueHealthEffectsController(IGameController gc, HealthController health) { _gc = gc; _healthController = health; }
public Engine(IReader reader, IWriter writer, IMissionController missionController, IGameController gameController, IArmy army, IWareHouse wareHouse , ISoldierFactory soldierFactory, IMissionFactory missionFactory, IAmmunitionFactory ammunitionFactory) { this.reader = reader; this.writer = writer; this.missionController = missionController; this.gameController = gameController; this.army = army; this.wareHouse = wareHouse; this.soldierFactory = soldierFactory; this.missionFactory = missionFactory; this.ammunitionFactory = ammunitionFactory; }
public LampShowMode(IGameController game) : base(game, 3) { this.Lampshow = new LampShow(game); this.ShowOver = true; }
public void PlayTurn(IGameController gameController, Object player) { _isInteractive = false; //We basically need to consider each move based on the impact to the game, and how many turns //ahead it will need to be. Often it will be better to look at the best multi-turn move combination //rather than the single best move for this turn. //We could give each turn possibility a ranking, then decide from that. But that means we'll have //to process every option before we take one, which will take more time. If we can be certain //of the order in which we will want to implement each option then we don't need to process the //options. We jst need to consider them in order. I'm not sure method I'll take yet, but I'm //going to go ahead with the assumption that we can just do each check in a linear order unless //I encounter something that proves otherwise. //==== End Moves ==== //=================== //This turn compulsions //--------------------- //Look for a winning possibility and complete it var potentialWinningTiles = AIHelper.FindDirectWinningPossibilities( gameController.Game.Board, player); if (potentialWinningTiles.Count != 0 && WillSeeImmediateWin(potentialWinningTiles.Count, gameController.Game.Board)) { //Depending on how easy the difficulty is, and how many tokens are on the board //the AI should be able to miss a chance to win. There should be more chance //to see the win the more potential winning tiles there are. PlaceTokenInOneOfTheseTiles(gameController, potentialWinningTiles); return; } //Look to see if the opponent will be able to complete his move next turn, and block it. var potentialLosingTiles = AIHelper.FindDirectWinningPossibilities( gameController.Game.Board, gameController.Game.GetOtherPlayer(player)); if (potentialLosingTiles.Count != 0 && WillSeeImmediateLoss(potentialLosingTiles.Count, gameController.Game.Board)) { //Depending on how easy the difficulty is, and how many tokens are on the board //the AI should be able to miss a chance to stop the opponent. There should //be less chance to miss the more potential losing tiles there are. PlaceTokenInOneOfTheseTiles(gameController, potentialLosingTiles); return; } //Two turn compulstions //--------------------- if (CanCreateCompulsion(gameController.Game.Board)) { //Look to see if we have a move that will force the other player into giving us the win //in the next turn, and do it. var compulsionTiles = AIHelper.FindTwoTurnCompulsionWin(gameController.Game, player); if (compulsionTiles.Count != 0) { PlaceTokenInOneOfTheseTiles(gameController, compulsionTiles); return; } } if (CanBlockOpponentCompulsion(gameController.Game.Board)) { //when there's a small amount of //Look for the above thing for the opponent. A move which will force us to make a defensive blocking //move, and give him the win on the next turn. //Note that FindCompulsionWinBlockingTiles() will not return any blocks if there is a compulsion //and it can't be blocked var compulsionBlocks = FindCompulsionWinBlockingTiles(gameController, player); if (compulsionBlocks.Count != 0) { PlaceTokenInOneOfTheseTiles(gameController, compulsionBlocks); return; } } //Three plus turn compulsions //--------------------------- //Three turn compulsions are less likley to occur in the game, so I'm not going to consider them at //this point. Though doing so should just be a modification and additional search based on the //two-turn compulsion //==== Mid And Early Game Moves ==== //================================== //Now go through and rate each of the playable tiles var ratings = RatePosibilePlacements(gameController.Game, player); if (ratings.Count != 0) { List<Tile> placementOptions = null; if (_UseFuzzyLogicOnRatings) { placementOptions = ChoosePlacementBasedOnFuzzyLogic(ratings); } else { placementOptions = ChoosePlacementTilesBasedOnHighestRating(ratings); } PlaceTokenInOneOfTheseTiles(gameController, placementOptions); return; } // If there are no good options, then place a token as low and centeral as possible. // (I'm not actually sure if this is a very optimial strategy. I would have to do some testing //with different options (random, low and sides, high and central, high and sides, third poins, etc)) //For testing, just randomly place the token. //For testing we are going to make it interactive. _isInteractive = true; }
public StatController(IGameController gameController) { _gameController = gameController; }
public GameStateController(IGameController gameController, IGameInputCollector gameInputCollector) { _gameController = gameController; _gameInputCollector = gameInputCollector; }
public override void ApplyCondition(IGameController controller) { controller.AddCodeword(Value); }
public override void ApplyCondition(IGameController controller) { controller.MovePlayer(NextScene, null, string.Empty); }
private void StartNewGame(IGameController gameController) { GameManager.TheGameManager.ReInitializeGame(gameController); }
public FluMonitor(IGameController gc) : base(gc) { }
/// <summary> /// Pobiera nowy obiekt ustawień dla kontrolera. /// </summary> /// <remarks> /// Jeśli kontroler nie definiuje tego atrybutu zwracany jest obiekt <see cref="DefaultGameplaySettings"/>. /// </remarks> /// <param name="controller">Kontroler.</param> /// <returns>Nowy obiekt ustawień dla klasy.</returns> public static IGameplaySettings GetSettingsFor(IGameController controller) { return GetSettingsFor(controller.GetType()); }
public void InitilizeController() { this.inputReader = new Mock<IInputReader>(); this.messenger = new Mock<IControllerMessenger>(); this.playgroundRender = new Mock<IPlaygroundRender>(); this.gameController = new GameController(this.inputReader.Object, this.messenger.Object, this.playgroundRender.Object); }
public ServerProtocol(IGameController controller) { _controller = controller; }
public void Construct(IGameController gameController, IPlayerController playerController, IStatController statController) { _gameController = gameController; _playerController = playerController; _statController = statController; }
public override bool IsConditionFulfilled(IGameController controller, IEnemy enemy = null) { return(true); }
public Game(GameType type, IGameController controller, IMovementManager movementManager) { this.Type = type; this.Controller = controller; this.MovementManager = movementManager; }
void Awake() { m_gameController = SnapGameContext.GetGameController(this); m_gameController.StartNewGame(); }
private void Start() { game = (IGameController)GameObject.FindGameObjectWithTag("gameController").GetComponent(typeof(IGameController)); }
protected DiseaseMonitorBase(IGameController gc) { _gc = gc; }
public AsteroidsGame(IGameForm parent, IGameController gameController) : base(parent) { StartNewRound(); _gameController = gameController; }
public void Init(IGameController gameController) { _gameController = gameController; _gameController.OnGameStateChange += HandleGameChange; }
public ClientProtocol(IGameController controller) { _controller = controller; }
private void ComposeServices() { this.terrainService = new TerrainService( this); this.headUpDisplayService = new HeadUpDisplayService( this); this.audioService = new AudioService( this); this.enemyFactory = new EnemyFactory( this, terrainService); this.enemyService = new EnemyService( this, enemyFactory); this.playerFactory = new PlayerFactory( this); this.inputService = new InputService( this); this.playerService = new PlayerService( this, inputService, audioService, playerFactory, terrainService); this.collisionDetectionService = new CollisionDetectionService( this, playerService, enemyService, terrainService); this.gameController = new GameController( this, collisionDetectionService, playerService, enemyService, inputService, headUpDisplayService, terrainService, audioService); try { var consoleAssembly = Assembly.Load("SpaceFighter.Console"); var consoleServiceType = consoleAssembly.GetType("SpaceFighter.Console.ConsoleService"); var consoleService = Activator.CreateInstance(consoleServiceType, this); this.Components.Add(consoleService as IGameComponent); } catch(FileNotFoundException) { // No console support available } }
// IView interface implementation: public void SetController(IGameController controller) { this.controller = controller; }
public bool OnApplianceTaken(IGameController gc, ApplianceInfo applianceInfo, ActiveDisease disease) { if (IsFinished) { return(false); } if (!gc.WorldTime.HasValue) { return(false); } if (disease.IsSelfHealing) { return(false); } var treatedStage = disease.TreatedStage; if (treatedStage == null) { treatedStage = disease.GetActiveStage(gc.WorldTime.Value); } if (treatedStage == null) { return(false); } var isTreatedLevel = treatedStage.Level == _treatedLevel; if (applianceInfo.Appliance.Name == _applianceName && (_bodyPart == null || applianceInfo.BodyPart == _bodyPart)) { var currentTime = gc.WorldTime.Value; if (_consumedTimes.Count == 0) { // First consume _inTimeConsumedCount++; _consumedTimes.Add(currentTime); if (isTreatedLevel) { IsFinished = false; CheckIfTreatmentFinished(disease); if (OnTreatmentStarted != null) { OnTreatmentStarted.Invoke(); } //("Disease appliance treatment started."); IsStarted = true; if (!IsNodePart && !IsFinished) { //("Overall disease treatment started."); Events.NotifyAll(l => l.DiseaseTreatmentStarted(disease.Disease)); // We're starting to heal disease.Invert(); } } } else { IsFinished = false; var lastTime = _consumedTimes.Last(); var minutes = (currentTime - lastTime).TotalMinutes; if (minutes <= _timingInGameMinutes + TimingDeltaBetweenAllowedConsuming && minutes >= _timingInGameMinutes - TimingDeltaBetweenAllowedConsuming) { _inTimeConsumedCount++; _consumedTimes.Add(currentTime); if (isTreatedLevel) { CheckIfTreatmentFinished(disease); } } } return(true); } return(false); }
public override void Check(ActiveDisease disease, IGameController gc) { _progressingStageTreatment.Check(disease, gc); _worryingStageTreatment.Check(disease, gc); _criticalingStageTreatment.Check(disease, gc); }
public void SwitchToPauseMenu(IGameController gameController) { throw new NotImplementedException(); }
public const int UnsafeWaterFoodPoisoningChance = 60; // percents public FoodPoisoningMonitor(IGameController gc) : base(gc) { }
public MoveDownCommand(IGameController gameController) { _gameController = gameController; }
public SoldierRegenerateCommand(IList <string> cmdArgs, IGameController gameController) : base(cmdArgs, gameController) { }
public ActiveController(IGameController controller) { Id = controller.Game.Id; Game = controller.Game.CloneJson(); }
public MedicalAgentsSideEffectsController(IGameController gc) { _gc = gc; }
public IGameView Create(IGameController gameController, ISolitaireGameModel gameModel) => new ConsoleGameView(gameController, gameModel, _serviceProvider.GetRequiredService <IStringViewProvider <Card> >(), _serviceProvider.GetRequiredService <IStringViewProvider <CardSuit> >());
public void PlaceTokenInOneOfTheseTiles(IGameController gameController, List<Game.Tile> tiles) { if (tiles.Count == 1) { gameController.Game.DropTokenOnColumn(tiles[0].ColumnNo); } else { var rand = new Random(); var randomTile = tiles[ rand.Next(tiles.Count - 1) ]; gameController.Game.DropTokenOnColumn(randomTile.ColumnNo); } }
public void SetController(IGameController gameController) { GameController = gameController; }
public void PlayGame(Game game) { if (!game.IsInstalled) { InstallGame(game); return; } logger.Info($"Starting {game.GetIdentifierInfo()}"); var dbGame = Database.Games.Get(game.Id); if (dbGame == null) { Dialogs.ShowMessage( string.Format(resources.GetString("LOCGameStartErrorNoGame"), game.Name), resources.GetString("LOCGameError"), MessageBoxButton.OK, MessageBoxImage.Error); UpdateJumpList(); return; } IGameController controller = null; try { if (game.IsRunning) { logger.Warn("Failed to start the game, game is already running."); return; } if (game.PlayAction.IsHandledByPlugin) { logger.Info("Using library plugin to start the game."); controller = controllers.GetGameBasedController(game, Extensions); } else { logger.Info("Using generic controller start the game."); controller = controllers.GetGenericGameController(game); } if (controller == null) { Dialogs.ShowErrorMessage( resources.GetString("LOCErrorLibraryPluginNotFound"), resources.GetString("LOCGameError")); return; } controllers.RemoveController(game.Id); controllers.AddController(controller); UpdateGameState(game.Id, null, null, null, null, true); controller.Play(); } catch (Exception exc) when(!PlayniteEnvironment.ThrowAllErrors) { if (controller != null) { controllers.RemoveController(game.Id); UpdateGameState(game.Id, null, null, null, null, false); } logger.Error(exc, "Cannot start game: "); Dialogs.ShowMessage( string.Format(resources.GetString("LOCGameStartError"), exc.Message), resources.GetString("LOCGameError"), MessageBoxButton.OK, MessageBoxImage.Error); return; } try { UpdateJumpList(); } catch (Exception exc) when(!PlayniteEnvironment.ThrowAllErrors) { logger.Error(exc, "Failed to set jump list data: "); } }
public TimedEventByChance(IGameController gc, string name, Action <TimedEventByChance> eventStartHappenningAction, Action <TimedEventByChance> eventEndHappenningAction, TimeSpan eventDurationInGameTime, float realSecondsBetweenChecks) : this(gc, name, eventStartHappenningAction, eventEndHappenningAction, eventDurationInGameTime, null, 0, realSecondsBetweenChecks, 0) { }
public IGameBuilder GameController(IGameController gameController) { this._gameController = gameController; return(this); }
public TimedEventByChance(IGameController gc, string name, Action <TimedEventByChance> eventStartHappenningAction, Action <TimedEventByChance> eventEndHappenningAction, TimeSpan eventDurationInGameTime, Pair <int> durationPercentRandomizer, float realSecondsBetweenChecks) : this(gc, name, eventStartHappenningAction, eventEndHappenningAction, eventDurationInGameTime, durationPercentRandomizer, 0, realSecondsBetweenChecks, 0) { }
public List<Tile> FindCompulsionWinBlockingTiles(IGameController gameController, Object player) { var opponentCompulsionTiles = AIHelper.FindTwoTurnCompulsionWin(gameController.Game, gameController.Game.GetOtherPlayer(player)); //We may or may not be able to block this compulsion... We'll need to check each //column to see if placing a tile wouldn't create a direct win or compulsion. If we can find //one that doesn't we should drop a token there. var compulsionBlockingTiles = new List<Tile>(); opponentCompulsionTiles.ForEach(tile => { var copyGame = gameController.Game.Copy(); copyGame.DropTokenOnColumn(tile.ColumnNo); var winningPossiblities = AIHelper.FindDirectWinningPossibilities(copyGame.Board, copyGame.CurrentPlayer); var twoTurnCompulsions = AIHelper.FindTwoTurnCompulsionWin(copyGame, copyGame.CurrentPlayer); if (winningPossiblities.Count == 0 && twoTurnCompulsions.Count == 0) { compulsionBlockingTiles.Add(tile); } }); return compulsionBlockingTiles; //Hmm this method is a bit brute forced. I wonder if there's different situations and cases we can //look at to block the compulsion... In many cases where the other player must place a tile to //start a compulsion, we could block by placing one there first. That's because it depends on //us building the final tile, which we can prematuraley stop. Other cases it doesn't matter //what we do, because placing the blocking tile gives them the opportunity to win straight away. // // // // . . x x . . . ////////////////// //In the above case placing a token to either side of the x's will block the compulsion // x x x // t t t // t t t // t t t x // t t t x . . . ///////////////// //In this case if we place a token above the 4th column we will block a compulsion. If //we don't then the user will force a compulsion on us // // x x x // t x t // x t t t . . . //////////////// //In this case there is nothing we can do to stop a compulsion. If we place a token in the //4th column the opponent will win in the next turn. If they place one there then we will //have to block it and they will win on the diagonal. //In all the above cases where we can block the compulsion, we do it by placing a token //on the same column that the opponent would. Are there situations where would need //to place a token elsewhere to stop the compulsion? None that I can think of... }
public GameControllerTest() { mockDisplay = new Mock <IDisplayController>(); mockLoader = new Mock <ILoadController>(); gameController = new GameController(mockDisplay.Object, mockLoader.Object); }
public GameplayGameState(IGameController gameController) { this.Visible = true; this.gameplayScreen = new GameplayScreen(gameController); }
public void PlayTurn(IGameController gameController) { if (_ai != null) { _ai.PlayTurn(gameController, this); } else { //The the human player take their turn as they may } }
protected TileTypeTool(IGameController input, IntRect iconRectangle) : base(input, iconRectangle) { }
/// <summary> /// Inicjalizuje grę. /// </summary> /// <param name="mp">Główny obiekt gry.</param> public MultiplayerGameState(IMultiplayer mp) { this.Game = mp; this.Entities = new ClashEngine.NET.EntitiesManager.EntitiesManager(mp.GameInfo); this.VictoryRules = System.Activator.CreateInstance(ServerConfiguration.Instance.VictoryRules) as IVictoryRules; this.Controller = System.Activator.CreateInstance(ServerConfiguration.Instance.GameController) as IGameController; this.Settings = ServerConfiguration.Instance.ControllerSettings; this.Map = new Maps.DefaultMap(); }