public GameViewModel(IServerGameService serverGame, IUserService userService) { _serverGame = serverGame; _userService = userService; _serverGame.MoveFinished += ServerGame_MoveFinished; MoveCommand = new RelayCommand <string>(Move, CanMove); MoveEatenCommand = new RelayCommand <string>(MoveEaten, CanMoveEaten); GoHomeCommand = new RelayCommand <string>(GoHome, CanMove); ResignCommand = new RelayCommand(Resign, CanResign); Task t = LoadGame(); }
public LobbyViewModel(IServerGameService serverGame, IServerChatService serverChat, IServerUserService serverUser, IUserService userService, INavigationService nav, IChatService chatService, IGameService gameService) { _serverUser = serverUser; _serverChat = serverChat; _serverGame = serverGame; _userService = userService; _nav = nav; _chatService = chatService; _gameService = gameService; _serverUser.LogInCompleted += Server_LogInCompleted; _serverUser.LogOutCompleted += Server_LogOutCompleted; _serverChat.MessageReceivedCheck += Server_MessageReceivedCheck; _serverGame.GameRequested += Server_GameRequested; _serverGame.GameAccepted += Server_GameAccepted; _serverGame.GameDeclined += Server_GameDeclined; _gameRequests = new List <string>(); LogOutCommand = new RelayCommand(LogOut); StartChatCommand = new RelayCommand <string>(StartChat); RequestGameCommand = new RelayCommand <string>(RequestGame); Task t = LoadUsers(); }
public GameService(IServerGameService server) { _server = server; _games = new List <GameWindow>(); }