public LobbyState(IGameStateService gameStateService, IGuiService guiService, IInputService inputService, GraphicsDeviceManager graphics, ContentManager content, String username) { allRoom = Game1.main_console.ListRooms(); this.gameStateService = gameStateService; this.guiService = guiService; this.inputService = inputService; this.graphics = graphics; this.content = content; this.username = username; this.page = 0; roomIDLabels = new List<LabelControl>(); roomCapLabels = new List<LabelControl>(); joinButtons = new List<ButtonControl>(); panelVisibility = new List<bool>(); joinEventHandlers = new List<EventHandler>(); this.mouseMove = new MouseMoveDelegate(mouseMoved); lobbyScreen = new Screen(1194, 692); /*mainMenuScreen.Desktop.Bounds = new UniRectangle( new UniScalar(0.1f, 0.0f), new UniScalar(0.1f, 0.0f), // x and y = 10% new UniScalar(0.8f, 0.0f), new UniScalar(0.8f, 0.0f) // width and height = 80% );*/ spriteBatch = new SpriteBatch(graphics.GraphicsDevice); LoadContent(lobbyScreen, content); }
public RoomState(IGameState previousState, IGameStateService gameStateService, IGuiService guiService, IInputService inputService, GraphicsDeviceManager graphics, ContentManager content) { this.gameStateService = gameStateService; this.guiService = guiService; this.inputService = inputService; this.graphics = graphics; this.content = content; this.previousState = previousState; this.mouseMove = new MouseMoveDelegate(mouseMoved); this.teamA = new List<Peer>(); this.teamB = new List<Peer>(); playerIDLabels = new List<LabelControl>(); panelVisibility = new List<bool>(); roomScreen = new Screen(1184, 682); Game1.main_console.StartEvent += Start; spriteBatch = new SpriteBatch(graphics.GraphicsDevice); LoadContent(roomScreen, content); }
public CoordinateTests() { _orthogonalService = ServiceProvider.GetService <IOrthogonalService>(); _attackService = ServiceProvider.GetService <IAttackService>(); _gameStateService = ServiceProvider.GetService <IGameStateService>(); _moveService = ServiceProvider.GetService <IMoveService>(); }
public BattleSimulator(IGameStateService gameStateService, IMonsterAIService monsterAIService, ILogService logService, ISkillSimulator skillSimulator) { this.gameStateService = gameStateService; this.monsterAIService = monsterAIService; this.logService = logService; this.skillSimulator = skillSimulator; }
//раздуватель - длинный список параетров public MoveCommand(IGameStateService changeGameState, IPlayerStateService changePlayerState, MoveParameter parameter) { gameState = changeGameState; playerState = changePlayerState; this.parameter = parameter; actionCharge = 5; }
public SaveProjectCommand(IGameStateService gameStateService, IFilePicker filePicker, IWindowProvider windowProvider, ProjectSettingsViewModel projectSettingsViewModel) { _gameStateService = gameStateService; _filePicker = filePicker; _windowProvider = windowProvider; _projectSettingsViewModel = projectSettingsViewModel; _gameStateService.OnGameCreated += _gameStateService_OnGameCreated; _gameStateService.OnGameChanged += _gameStateService_OnGameChanged; }
public PlayersService(ILogger logger, IGameStateService gameStateService, IBotService botService, IPlayersServiceView view) : base(logger) { this.botService = botService; this.view = view; this.gameState = gameStateService.GetOrCreateGameState(); }
public GameInfoService(IGameInfoRepository gameInfoRepository, IMessageService messageService, IGameQuestionService gameQuestionService, IGameTimerService gameTimerService, IGameStateService gameStateService) { this.gameInfoRepository = gameInfoRepository; this.messageService = messageService; this.gameQuestionService = gameQuestionService; this.gameTimerService = gameTimerService; this.gameStateService = gameStateService; }
public GameStepNavigationViewModel(IGameStateService gameStateService, IGamePartService gamePartService) { _gameStateService = gameStateService; _gamePartService = gamePartService; _totalGameParts = _gamePartService.GetTotalNumberOfGameParts(); CurrentGamePart = gameStateService.GetCurrentActiveGamePart(); }
public void Init() { _piecesOnBoard.Clear(); _piecesNotBeingDraggedRightNow.Clear(); _piecesWithinSnappingDistance.Clear(); _pieceBeingDragged = new IntVector2(); _totalPieceCount = -1; _gameStateService = ServiceLocator.Get <IGameStateService>(); }
public GameManager(ILogger logger, IPlayersService playersService, IGameStateService gameStateService, IValidWordVerifier challengeVerifier, IGameManagerView gameView) : base(logger) { this.playersService = playersService; this.challengeVerifier = challengeVerifier; this.gameState = gameStateService.GetOrCreateGameState(); this.gameView = gameView; }
public override void InitReference(IServiceContainer serviceContainer, IManagerContainer mgrContainer = null) { base.InitReference(serviceContainer, mgrContainer); _gameEffectService = serviceContainer.GetService <IGameEffectService>(); _gameAudioService = serviceContainer.GetService <IGameAudioService>(); _gameStateService = serviceContainer.GetService <IGameStateService>(); _gameConfigService = serviceContainer.GetService <IGameConfigService>(); _gameCollisionService = serviceContainer.GetService <IGameCollision2DService>(); _gameConstStateService = serviceContainer.GetService <IGameConstStateService>(); _gameUnitService = serviceContainer.GetService <IGameUnitService>(); }
/// <summary>Initializes a new loading screen game state</summary> /// <param name="gameStateService"> /// Game state manager the loading screen state belongs to /// </param> /// <param name="gameStateToLoad"> /// Game state that will be loaded by the loading screen /// </param> public LoadingScreenState( IGameStateService gameStateService, LoadedGameStateType gameStateToLoad ) { this.gameStateService = gameStateService; this.gameStateToLoad = gameStateToLoad; this.progressChangedDelegate = new EventHandler <LoadProgressEventArgs>( progressChanged ); }
protected override void OnInitReference(IServiceContainer serviceContainer, IManagerContainer mgrContainer) { _gameEffectService = serviceContainer.GetService <IGameEffectService>(); _gameAudioService = serviceContainer.GetService <IGameAudioService>(); _gameStateService = serviceContainer.GetService <IGameStateService>(); _gameConfigService = serviceContainer.GetService <IGameConfigService>(); _gameResourceService = serviceContainer.GetService <IGameResourceService>(); _gameConstStateService = serviceContainer.GetService <IGameConstStateService>(); _gameCollision2DService = serviceContainer.GetService <IGameCollision2DService>(); _gameUnitService = serviceContainer.GetService <IGameUnitService>(); }
public CharacterFactory(ILogService logService, ISkillFactory skillFactory, IDatabaseService databaseService, IConfigurator configurator, ITalentFactory talentFactory, ICharacterPlacementService characterPlacementService, IGameStateService gameStateService) { this.logService = logService; this.skillFactory = skillFactory; this.databaseService = databaseService; this.configurator = configurator; this.talentFactory = talentFactory; this.characterPlacementService = characterPlacementService; this.gameStateService = gameStateService; }
internal static GameState GetGameState(IGameStateService gameStateService, string fen = "") { if (string.IsNullOrEmpty(fen)) { fen = GeneralReference.Starting_FEN_Position; } var gamestateResult = gameStateService.Initialize(fen); Assert.IsTrue(gamestateResult.Success); var gamestate = gamestateResult.Result; return(gamestate); }
public ServerNetworkGameStateContext( NetIncomingMessageBusService <NetServer> netIncomingMessageBusService, NetOutgoingMessageBusService <NetServer> netOutgoingMessageBusService, IInputTranslator <NetIncomingMessage, NetworkCommandConnection> networkCommandServerTranslator, IGameStateService <byte, TWorld> gameStateService, ILogger <byte> logger) { CurrentNetIncomingMessageBusService = netIncomingMessageBusService ?? throw new ArgumentNullException(nameof(netIncomingMessageBusService)); CurrentNetOutgoingMessageBusService = netOutgoingMessageBusService ?? throw new ArgumentNullException(nameof(netOutgoingMessageBusService)); CurrentNetworkCommandServerTranslator = networkCommandServerTranslator ?? throw new ArgumentNullException(nameof(networkCommandServerTranslator)); GameStateRegistrar = gameStateService ?? throw new ArgumentNullException(nameof(gameStateService)); Logger = logger ?? throw new ArgumentNullException(nameof(logger)); }
public LoginService( IAccountService accountService, IGameStateService gameStateService, ILogService logService, ICharacterPlacementService characterPlacementService, IDatabaseService databaseService, IServerManager serverManager) { this.accountService = accountService; this.gameStateService = gameStateService; this.logService = logService; this.characterPlacementService = characterPlacementService; this.databaseService = databaseService; this.serverManager = serverManager; }
private void ConnectLoadedPieces(IGameStateService gameStateService) { foreach (var root in gameStateService.Roots) { for (int i = 0; i < root.connectedBoardPositions.Count; ++i) { var a = FindPiece(root.connectedBoardPositions[i]); for (int j = i + 1; j < root.connectedBoardPositions.Count; ++j) { var b = FindPiece(root.connectedBoardPositions[j]); ConnectPieces(a, b); } } } }
private void SnapLoadedPieces(IGameStateService gameStateService) { foreach (var root in gameStateService.Roots) { var pieceToKeepSteady = FindPiece(root.boardPosition); foreach (var connectedPosition in root.connectedBoardPositions) { if (connectedPosition != root.boardPosition) { var connectedPiece = FindPiece(connectedPosition); SnapToPieceAt(pieceToKeepSteady, connectedPiece); } } } }
public override void InitReference(IServiceContainer serviceContainer, IManagerContainer mgrContainer) { base.InitReference(serviceContainer, mgrContainer); _networkService = serviceContainer.GetService <INetworkService>(); SimulatorServiceService = serviceContainer.GetService <ISimulatorService>(); _uiService = serviceContainer.GetService <IUIService>(); _gameEffectService = serviceContainer.GetService <IGameEffectService>(); _gameAudioService = serviceContainer.GetService <IGameAudioService>(); _gameStateService = serviceContainer.GetService <IGameStateService>(); _gameConfigService = serviceContainer.GetService <IGameConfigService>(); _gameViewService = serviceContainer.GetService <IGameViewService>(); _gameResourceService = serviceContainer.GetService <IGameResourceService>(); }
public GameStateController(RequestScope scopeContext, IGameStateService service, IMatchService matchService, IHttpContextAccessor httpContextAccessor, IMatchDetailsService matchDetailsService, IPlayerService playerService, MatchHub matchHub, IPlayerStatsService playerStatsService) : base(scopeContext, service) { _matchService = matchService; _httpContextAccessor = httpContextAccessor; _playerService = playerService; _matchDetailsService = matchDetailsService; _playerStatsService = playerStatsService; _matchHub = matchHub; }
private static OperationResult <GameState> playFromHistoryToAPoint(IGameStateService gameStateService, GameState gameState, int historyIndex, Snapshot initialFen) { var nextGameState = gameStateService.Initialize(initialFen.ToString()); for (int i = 0; i < historyIndex; i++) { var pgnMove = gameState.PGNMoves[i]; nextGameState = gameStateService.MakeMove(nextGameState.Result, pgnMove); if (nextGameState.Failure) { return(OperationResult <GameState> .Fail($"Couldn't make the moves that were recorded. { nextGameState.Message }")); } } return(OperationResult <GameState> .Ok(nextGameState.Result)); }
public void InitReference(IServiceContainer serviceContainer) { _resourceService = serviceContainer.GetService <IResourceService>(); _audioService = serviceContainer.GetService <IAudioService>(); _inputService = serviceContainer.GetService <IInputService>(); _mapService = serviceContainer.GetService <IMapService>(); _eventRegisterService = serviceContainer.GetService <IEventRegisterService>(); _viewService = serviceContainer.GetService <IViewService>(); _unitService = serviceContainer.GetService <IUnitService>(); _randomService = serviceContainer.GetService <IRandomService>(); _timeMachineService = serviceContainer.GetService <ITimeMachineService>(); _constStateService = serviceContainer.GetService <IConstGameStateService>(); _gameStateService = serviceContainer.GetService <IGameStateService>(); _networkService = serviceContainer.GetService <INetworkService>(); }
void Initialize([Inject] IGameStateService service) { _service = service; this.OnEvent <RegisterGameStateCommand>().Subscribe(e => RegisterGameStateCommandHandler(e)).AddTo(this); this.OnEvent <GetCurrentGameStateCommand>().Subscribe(e => GetCurrentGameStateCommandHandler(e)).AddTo(this); this.OnEvent <StartGameStateCommand>().Subscribe(e => StartGameStateCommandHandler(e)).AddTo(this); this.OnEvent <StopGameStateCommand>().Subscribe(e => StopGameStateCommandHandler(e)).AddTo(this); this.OnEvent <GetGameStateCommand>().Subscribe(e => GetGameStateCommandHandler(e)).AddTo(this); this.OnEvent <TickCommand>().Subscribe(e => TickCommandHandler(e)).AddTo(this); }
public GameLoopSimulator( ILogService logService, IHubService hubService, IGameStateService gameStateService, IPlayerActionCollection playerActionQueue, IPlayerActionExecutor playerActionExecutor, IBattleSimulator battleSimulator ) { this.logService = logService; this.hubService = hubService; this.gameStateService = gameStateService; this.playerActionExecutor = playerActionExecutor; this.battleSimulator = battleSimulator; this.playerActionQueue = playerActionQueue; syncCoordinator = new SyncCoordinator(); playerActionExecutor.SetSyncCoordinator(syncCoordinator); tickCount = 0; }
public static OperationResult <GameStateResource> MoveToHistoryIndex(IGameStateService gameStateService, GameState gameState, int historyIndex) { if (historyIndex == 0) { return(ToGameStateResource(gameStateService.Initialize().Result)); } if (gameState.History.Count < historyIndex) { return(OperationResult <GameStateResource> .Fail("Index was lower than history count.")); } var initialFen = gameState.History.FirstOrDefault(); if (initialFen == null) { return(OperationResult <GameStateResource> .Fail("Couldn't find initial position.")); } var newGameState = playFromHistoryToAPoint(gameStateService, gameState, historyIndex, initialFen); return(ToGameStateResource(newGameState.Result)); }
public GameFactory( IGameStateService gameStateService, IDatabaseService databaseService, ILogService logService, IConfigurator configurator, IRandomService randomService, IUniverseFactory universeFactory, IWorldFactory worldFactory, IAreaFactory areaFactory, ISectionFactory sectionFactory) { this.gameStateService = gameStateService; this.databaseService = databaseService; this.logService = logService; this.configurator = configurator; this.randomService = randomService; this.universeFactory = universeFactory; this.worldFactory = worldFactory; this.areaFactory = areaFactory; this.sectionFactory = sectionFactory; }
protected override void OnInit(BaseContext context, IServiceContainer services) { _context = (Context)context; //BuildInServices _randomService = services.GetService <IRandomService>(); _timeMachineService = services.GetService <ITimeMachineService>(); _globalStateService = services.GetService <IGlobalStateService>(); _viewService = services.GetService <IViewService>(); _audioService = services.GetService <IAudioService>(); _inputService = services.GetService <IInputService>(); _map2DService = services.GetService <IMap2DService>(); _resService = services.GetService <IResService>(); _effectService = services.GetService <IEffectService>(); _eventRegisterService = services.GetService <IEventRegisterService>(); _idService = services.GetService <IIdService>(); _debugService = services.GetService <IDebugService>(); //GameServices _gameStateService = services.GetService <IGameStateService>(); _gameConfigService = services.GetService <IGameConfigService>(); _gameEventService = services.GetService <IGameEventService>(); }
public MainMenuState(IGameStateService gameStateService, IGuiService guiService, IInputService inputService, GraphicsDeviceManager graphics, ContentManager content) { this.gameStateService = gameStateService; this.guiService = guiService; this.inputService = inputService; this.graphics = graphics; this.content = content; this.mouseMove = new MouseMoveDelegate(mouseMoved); this.keyHit = new KeyDelegate(keyboardEntered); mainMenuScreen = new Screen(349, 133); /*mainMenuScreen.Desktop.Bounds = new UniRectangle( new UniScalar(0.1f, 0.0f), new UniScalar(0.1f, 0.0f), // x and y = 10% new UniScalar(0.8f, 0.0f), new UniScalar(0.8f, 0.0f) // width and height = 80% );*/ spriteBatch = new SpriteBatch(graphics.GraphicsDevice); LoadContent(mainMenuScreen, content); }
public CreateRoomState(IGameStateService gameStateService, IGuiService guiService, IInputService inputService, GraphicsDeviceManager graphics, ContentManager content) { this.gameStateService = gameStateService; this.guiService = guiService; this.inputService = inputService; this.graphics = graphics; this.content = content; this.previousState = gameStateService.ActiveState; this.mouseMove = new MouseMoveDelegate(mouseMoved); createRoomScreen = new Screen(458, 274); /*mainMenuScreen.Desktop.Bounds = new UniRectangle( new UniScalar(0.1f, 0.0f), new UniScalar(0.1f, 0.0f), // x and y = 10% new UniScalar(0.8f, 0.0f), new UniScalar(0.8f, 0.0f) // width and height = 80% );*/ spriteBatch = new SpriteBatch(graphics.GraphicsDevice); LoadContent(createRoomScreen, content); }
public MainHub( ILogService logService, IGameStateService gameStateService, IPlayerActionCollection playerActionQueue, IServerManager serverManager, ILoginService loginService, IAccountService accountService, ICharacterFactory characterFactory, IQuestGiver questGiver, IDisconnectService disconnectService, IHubService hubService) { this.logService = logService; this.gameStateService = gameStateService; this.playerActionQueue = playerActionQueue; this.serverManager = serverManager; this.loginService = loginService; this.accountService = accountService; this.characterFactory = characterFactory; this.questGiver = questGiver; this.disconnectService = disconnectService; this.hubService = hubService; }
public void Shutdown() { OnPlayerHasWon = null; _gameStateService = null; }
public CheckmateTests() { _gameStateService = ServiceProvider.GetService <IGameStateService>(); }
public GameStart(IGameStateService gameStateService, IGuiService guiService, IInputService inputService, GraphicsDeviceManager graphics, ContentManager content, List<Peer> teamA, List<Peer> teamB) { this.gameStateService = gameStateService; this.guiService = guiService; this.inputService = inputService; this.graphics = graphics; this.Content = content; this.previousState = gameStateService.ActiveState; this.numberOfPlayers = Game1.main_console.Room.Members.Count(); gameStartScreen = new Screen(680, 680); spriteBatch = new SpriteBatch(graphics.GraphicsDevice); Game1.main_console.GameEvent += ProcessMessages; this.teamA = teamA; this.teamB = teamB; idxA = 0; idxB = 0; LoadContent(); }
private void Start() { RenderTarget = new PictureBox { Dock = DockStyle.Fill }; RenderBuffer = new Bitmap(800, 800); GraphicsDevice = Graphics.FromImage(RenderBuffer); Controls.Clear(); Controls.Add(RenderTarget); HqRenderer = new HeadQuaterRenderer(RenderBuffer, GraphicsDevice); BarrackRenderer = new BarrackRenderer(RenderBuffer, GraphicsDevice); InfanteryRenderer = new InfanteryRenderer(RenderBuffer, GraphicsDevice); HarvesterRenderer = new HarvesterRenderer(RenderBuffer, GraphicsDevice); GameStateService = new GameStateService(); DoubleBuffered = true; GameThread = new Thread(Work) {IsBackground = true}; GameThread.Start(); DrawThread = new Thread(Draw) { IsBackground = true, Priority = ThreadPriority.AboveNormal}; DrawThread.Start(); }