Ejemplo n.º 1
0
 protected override CardPileViewModel SelectPile(GameViewModel state, IGameClient client)
 {
     return GetValidBuys(state)                
         .Where(pile => Treasure.Basic.Contains(pile.Name))                
         .OrderByDescending(pile => pile.Cost)
         .First();
 }
Ejemplo n.º 2
0
        //        1. List<pos + DateTime (class)> // högre och högre tid på olika pos
        //        2. bild i ps, rita cirklar dra streck mellan dom..
        //        3. bygga på med vinklar (sist, till att börja med kör vi med position)
        public override void Initialize(GameContext context)
        {
            base.Initialize(context);

            snapShots = new List<Snapshot>();
            snapShots.Add(new Snapshot(TimeSpan.FromSeconds(0), new Vector2(487.0f, 585.0f)));
            snapShots.Add(new Snapshot(TimeSpan.FromSeconds(3), new Vector2(510.0f, 200.0f)));
            snapShots.Add(new Snapshot(TimeSpan.FromSeconds(7), new Vector2(775.0f, 326.0f)));
            snapShots.Add(new Snapshot(TimeSpan.FromSeconds(10), new Vector2(1142.0f, 103.0f)));

            this.spriteBatch = spriteBatch ?? new SpriteBatch(Context.Graphics.Device);

            time = "";
            interpolate = new Vector2();

            gameServer = ServiceLocator.Get<IGameServer>();
            gameClient = ServiceLocator.Get<IGameClient>();
            messageHandler = ServiceLocator.Get<IMessageHandler>();

            // Create the connection between the client and server
            gameServer.Start();
            gameClient.Connect();

            //sendTimer = new GameTimer(TimeSpan.FromMilliseconds(1000 / 20), SendClientSpatial);

            Context.Input.Keyboard.ClearMappings();
            Context.Input.Keyboard.AddMapping(Keys.F1);
            Context.Input.Keyboard.AddMapping(Keys.F2);
            Context.Input.Keyboard.AddMapping(Keys.F3);
        }
 private static void _NotifyRoomLayoutChanged(Room room)
 {
     if (room == null)
     {
         return;
     }
     foreach (var notify in room.Seats)
     {
         if (notify.Account != null)
         {
             try
             {
                 IGameClient channel = null;
                 lock (loggedInAccounts)
                 {
                     channel = loggedInAccounts[notify.Account.UserName].CallbackChannel;
                 }
                 Trace.Assert(channel != null);
                 channel.NotifyRoomUpdate(room.Id, room);
             }
             catch (Exception)
             {
             }
         }
     }
 }
Ejemplo n.º 4
0
 protected override CardPileViewModel SelectPile(GameViewModel state, IGameClient client)
 {
     return(GetValidBuys(state)
            .Where(pile => pile.Is(CardType.Victory))
            .OrderByDescending(pile => VictoryCards.Basic.Contains(pile.Name))
            .First());
 }
Ejemplo n.º 5
0
 public SessionManager(ITimeLogic timer, IGameClient clients)
 {
     _id      = Guid.NewGuid().ToString();
     _clients = clients;
     _timer   = timer;
     DoReset();
 }
Ejemplo n.º 6
0
 protected override CardPileViewModel SelectPile(GameViewModel state, IGameClient client)
 {
     return GetValidBuys(state)
         .Where(pile => pile.Is(CardType.Victory))
         .OrderByDescending(pile => VictoryCards.Basic.Contains(pile.Name))
         .First();
 }
Ejemplo n.º 7
0
 /// <summary>
 /// The human client will take on the race of the first 'opponent' in the gamesettings file.
 /// </summary>
 /// <param name="race">Race to play</param>
 public HumanClient(GameSettings gameSettings, GameSpeed speed = GameSpeed.Faster, ILogger log = null)
 {
     _settings = gameSettings;
     _client   = new GameClient(_settings, log);
     _speed    = speed;
     _log      = log;
 }
Ejemplo n.º 8
0
        public override void Initialize(GameContext context)
        {
            base.Initialize(context);

            globalSettings = ServiceLocator.Get<GlobalSettings>();
            gameClient = ServiceLocator.Get<IGameClient>();
        }
Ejemplo n.º 9
0
 public void Register(IGameClient client)
 {
     foreach (var bot in this.bots)
     {
         bot.Register(client);
     }
 }
Ejemplo n.º 10
0
 protected override CardPileViewModel SelectPile(GameViewModel state, IGameClient client)
 {
     return(GetValidBuys(state)
            .Where(pile => Treasure.Basic.Contains(pile.Name))
            .OrderByDescending(pile => pile.Cost)
            .First());
 }
Ejemplo n.º 11
0
    public void OnJoined(IGameClient client, int index, GameData.PlayerData playerData)
    {
        Node startBlock = GameBoard.FindBlockByName(playerData.currentBlockName);

        if (connectionViewController != null)
        {
            connectionViewController.Dismiss();
        }

        if (startBlock)
        {
            PlayerController playerController;
            if (PhotonNetwork.connectedAndReady)
            {
                playerController = PlayerController.createAvatarPlayer(playerData.colorPath, Vector3.zero, Quaternion.identity);
            }
            else
            {
                playerController = PlayerController.CreateLocalPlayer(playerData.colorPath);
            }

            GameBoard.MovePlayerToBlockNode(playerController, startBlock);


            if (players.ContainsKey(index) == false)
            {
                Debug.Log("add player at index: " + index);
                players.Add(index, new PlayerInfo(playerController, playerData));
            }
        }
    }
Ejemplo n.º 12
0
    private void InitMainMenu() {

        PatternProxyInst.Stopcandles();

        if (UseFakeNetworClient) {
            _networkClient = new LocalGameClient();
        } else {
            _networkClient = new GameClient("wss://ggj2016-server.herokuapp.com/room");
        }


        _networkClient.onConnected += ServerConnected;
        _networkClient.onLevelStarted += ServerLevelStarted;
        _networkClient.onGameStarted += ServerGameStarted;
        _networkClient.onEdgeFilled += EdgeFilledByPlayer;
        _networkClient.onLevelWon += ServerLevelWon;
        _networkClient.onClientError += ServerHadError;
        _networkClient.onGameCompleted += ServerCompletedGame;
        _networkClient.onLevelLost += ServerLostLevel;
        _networkClient.onNumberOfPlayersChanged += ServerNumberOfPlayersChanged;

        _networkClient.Connect();

        IngameUI.SetActive(false);
        MainMenuUI.SetActive(true);

        _currentLevel = -1;

        SoundManager.Instance.PlayBackgroundMusic();
    }
Ejemplo n.º 13
0
 private static void AutoSave(IGameClient client)
 {
     if ((DateTime.UtcNow - client.LastSave).TotalSeconds > ServerContext.Config.SaveRate)
     {
         client.Save();
     }
 }
Ejemplo n.º 14
0
 public void Attach(IGameClient client)
 {            
     _client = client;
     client.GameStateUpdates.ObserveOn(Scheduler.NewThread)
         //.Delay(TimeSpan.FromMilliseconds(new Random(client.GetHashCode()).Next(500, 1500)))
         .Subscribe(Respond);
 }
        public void Respond(IGameClient client, ActivityModel activity, GameViewModel state)
        {            
            if(!_enumerator.Current.CanRespond(activity, state))
                _enumerator.MoveNext();

            _enumerator.Current.Respond(client, activity, state);
            _enumerator.MoveNext();
        }
Ejemplo n.º 16
0
        public PollingDuplexClient(IGameClient gameClient)
            : base()
        {
            PollingDuplexMessageContext context = new PollingDuplexMessageContext(gameClient);

            context.Faulted += new EventHandler(context_Faulted);
            this.Context     = context;
        }
Ejemplo n.º 17
0
        public void Respond(IGameClient client, ActivityModel activity, GameViewModel state)
        {
            var pile = SelectPile(state);

            TalkSmack(pile, client);
            var message = new BuyCardMessage(client.PlayerId, pile.Id);            
            client.AcceptMessage(message);
        }
Ejemplo n.º 18
0
 public void Run(GameMode mode, IGameClient client)
 {
     Context.Run();
     Model = new GameModel(mode);
     View.ApplyModel(Model);
     Client = client;
     ApplyInitState();
 }
Ejemplo n.º 19
0
        public UnityRavenfallClient(
            ILogger logger,
            IMessageBus messageBus,
            IGameClient2 client)
        {
            this.logger     = logger;
            this.messageBus = messageBus;

            messageBus.Subscribe <TwitchUserJoined>(nameof(TwitchUserJoined), OnUserJoined);
            messageBus.Subscribe <TwitchUserLeft>(nameof(TwitchUserLeft), OnUserLeft);
            messageBus.Subscribe <TwitchCheer>(nameof(TwitchCheer), OnUserCheer);
            messageBus.Subscribe <TwitchSubscription>(nameof(TwitchSubscription), OnUserSub);

            this.client            = client;
            this.client.Connected += Client_OnConnect;
            this.client.Subscribe("join_failed", OnJoinFailed);
            this.client.Subscribe("join_success", SendResponseToTwitchChat);

            this.client.Subscribe("arena_join_success", SendResponseToTwitchChat);
            this.client.Subscribe("arena_join_failed", SendResponseToTwitchChat);

            this.client.Subscribe("raid_join_success", SendResponseToTwitchChat);
            this.client.Subscribe("raid_join_failed", SendResponseToTwitchChat);
            this.client.Subscribe("raid_start", OnRaidStart);

            this.client.Subscribe("player_stats", SendResponseToTwitchChat);
            this.client.Subscribe("player_resources", SendResponseToTwitchChat);
            this.client.Subscribe("highest_skill", SendResponseToTwitchChat);

            this.client.Subscribe("kick_success", OnKickPlayerSuccess);
            this.client.Subscribe("kick_failed", OnKickPlayerFailed);

            this.client.Subscribe("craft_success", SendResponseToTwitchChat);
            this.client.Subscribe("craft_failed", SendResponseToTwitchChat);

            this.client.Subscribe("duel_failed", SendResponseToTwitchChat);
            this.client.Subscribe("duel_alert", SendResponseToTwitchChat);
            this.client.Subscribe("duel_accept", SendResponseToTwitchChat);
            this.client.Subscribe("duel_declined", SendResponseToTwitchChat);
            this.client.Subscribe("duel_result", SendResponseToTwitchChat);

            this.client.Subscribe("item_pickup", SendResponseToTwitchChat);

            this.client.Subscribe("item_trade_result", SendResponseToTwitchChat);

            this.client.Subscribe("ferry_enter_failed", SendResponseToTwitchChat);
            this.client.Subscribe("ferry_leave_failed", SendResponseToTwitchChat);
            this.client.Subscribe("ferry_travel_failed", SendResponseToTwitchChat);

            this.client.Subscribe("train_failed", SendResponseToTwitchChat);

            this.client.Subscribe("ferry_success", SendResponseToTwitchChat);
            this.client.Subscribe("train_info", SendResponseToTwitchChat);
            this.client.Subscribe("island_info", SendResponseToTwitchChat);

            this.client.Subscribe("message", SendResponseToTwitchChat);
        }
        public void Respond(IGameClient client, ActivityModel activity, GameViewModel state)
        {
            var idsToTrash = state.Hand.Where(c => c.Is<Curse>() || c.Is<Copper>() || c.Is<Estate>())
                .Select(c => c.Id)
                .Take(activity.ParseNumberOfCardsToSelect())
                .ToArray();

            client.AcceptMessage(new SelectCardsMessage(client.PlayerId, idsToTrash));
        }
Ejemplo n.º 21
0
        public void Respond(IGameClient client, ActivityModel activity, GameViewModel state)
        {
            var idsToTrash = state.Hand.Where(c => c.Is <Curse>() || c.Is <Copper>() || c.Is <Estate>())
                             .Select(c => c.Id)
                             .Take(activity.ParseNumberOfCardsToSelect())
                             .ToArray();

            client.AcceptMessage(new SelectCardsMessage(client.PlayerId, idsToTrash));
        }
Ejemplo n.º 22
0
        private static void Pulse(TimeSpan elapsedTime, IGameClient client)
        {
            if (client?.Aisling != null)
            {
                ObjectComponent.UpdateClientObjects(client.Aisling);
            }

            client?.Update(elapsedTime);
        }
Ejemplo n.º 23
0
 public static SurrogateForIGameClient Convert(IGameClient value)
 {
     if (value == null)
     {
         return(null);
     }
     return(new SurrogateForIGameClient {
         Target = ((GameClientRef)value).Target
     });
 }
Ejemplo n.º 24
0
        protected override void TalkSmack(CardPileViewModel pile, IGameClient client)
        {
            base.TalkSmack(pile, client);

            if (pile.Name == "Province")
                client.SendChatMessage("Province muthafucka!");

            if (pile.Name == "Colony")
                client.SendChatMessage("COLONY! SUCK IT!");
        }
        public void Respond(IGameClient client, ActivityModel activity, GameViewModel state)
        {
            while (!_enumerator.Current.CanRespond(activity, state))
            {
                _enumerator.MoveNext();
            }

            _enumerator.Current.Respond(client, activity, state);
            _enumerator.MoveNext();
        }
Ejemplo n.º 26
0
        public MainLogic(IGameClient clients)
        {
            Logger.Trace("MainLogic");

            _clients = clients;
            _session = new SessionManager(timer: this, clients: _clients);

            CreateAuxLogics();
            InitSessionManager();
        }
Ejemplo n.º 27
0
    public void OnGameEnded(IGameClient game)
    {
        Debug.Log("Game Ended");

        ClearPlayers();

        ShowHud(false);
        //UINavigationController.PushBackground("/MainBackground");
        //UINavigationController.PushController("/GameOver");
    }
Ejemplo n.º 28
0
    public void SetGameClientPlugin(IGameClient gameClient)
    {
        if (GameClientPlugin != gameClient)
        {
            GameData.Load();
            var dataSlot = GameData.current.GetCurrentDataSlot();

            GameClientPlugin = gameClient;
            GameClientPlugin.Initialize(this, dataSlot);
        }
    }
Ejemplo n.º 29
0
        protected override CardPileViewModel SelectPile(GameViewModel state, IGameClient client)
        {
            var options = GetValidBuys(state).Where(c => _distribution.Contains(c.Name));

            var exactValueOptions = options
                                    .Where(pile => pile.Cost.ToString() == state.Status.AvailableSpend.DisplayValue);

            return(exactValueOptions.Any()
                ? _distribution.RandomItem(exactValueOptions, c => c.Name)
                : _distribution.RandomItem(options, c => c.Name));
        }
Ejemplo n.º 30
0
        public bool Withdraw(IGameClient client, string itemName)
        {
            if (!Items.ContainsKey(itemName))
            {
                return(false);
            }

            var itemObj = Items[itemName].Pop();

            return(itemObj?.GiveTo(client.Aisling) ?? false);
        }
Ejemplo n.º 31
0
        protected override CardPileViewModel SelectPile(GameViewModel state, IGameClient client)
        {
            var options = GetValidBuys(state).Where(c => _distribution.Contains(c.Name));

            var exactValueOptions = options
                .Where(pile => pile.Cost.ToString() == state.Status.AvailableSpend.DisplayValue);

            return exactValueOptions.Any() 
                ? _distribution.RandomItem(exactValueOptions, c => c.Name) 
                : _distribution.RandomItem(options, c => c.Name);
        }
Ejemplo n.º 32
0
        public void Respond(IGameClient client, ActivityModel activity, GameViewModel state)
        {
            var options = activity.ParseOptions();

            Choice choice = options.First();

            if (options.Contains(Choice.Yes))
                choice = Choice.Yes;

            client.AcceptMessage(new ChoiceMessage(client.PlayerId, choice.ToString()));
        }
Ejemplo n.º 33
0
            public void Respond(IGameClient client, ActivityModel activity, GameViewModel state)
            {
                var decklist = client.GetDecklist();

                if (state.Results.Winner == client.PlayerName)
                {
                    foreach (var card in decklist.Where(c => _distribution.Contains(c.Name)))
                    {
                        _distribution.IncreaseLikelihood(card.Name);
                    }
                }
            }
        public void Respond(IGameClient client, ActivityModel activity, GameViewModel state)
        {
            int count = activity.ParseNumberOfCardsToSelect();

            var ids = PrioritiseCards(state, activity)
                .Take(count)
                .Select(c => c.Id)
                .ToArray();
            
            var message = new SelectCardsMessage(client.PlayerId, ids);
            client.AcceptMessage(message);
        }
Ejemplo n.º 35
0
 public GameViewModel GetGameState(IGameClient client)
 {
     _lock.EnterReadLock();
     try
     {
         return(new GameViewModel(_game, _players[client]));
     }
     finally
     {
         _lock.ExitReadLock();
     }
 }
Ejemplo n.º 36
0
        public UnityBabyYodaClient(
            ILogger logger,
            IMessageBus messageBus,
            IGameClient2 client)
        {
            this.logger     = logger;
            this.messageBus = messageBus;

            this.client            = client;
            this.client.Connected += Client_OnConnect;
            this.client.Subscribe("message", SendResponseToTwitchChat);
        }
Ejemplo n.º 37
0
 public GameViewModel GetGameState(IGameClient client)
 {
     _lock.EnterReadLock();
     try
     {
         return new GameViewModel(_game, _players[client]);
     }
     finally
     {
         _lock.ExitReadLock();
     }
 }
Ejemplo n.º 38
0
        public void Attach(IGameClient client)
        {
            if (_client != null)
                _subscription.Dispose();

            _lastGameStateVersionHandled = 0;
            _lastActivityHandled = Guid.Empty;

            _client = client;
            _subscription = client.GameStateUpdates.ObserveOn(Scheduler.NewThread)
                .Subscribe(Respond);
        }
    private void RefreshTarget(IGameClient client)
    {
        if (client.Aisling.Dead)
        {
            ClearTarget();
        }

        if (client.Aisling.Invisible)
        {
            ClearTarget();
        }
    }
Ejemplo n.º 40
0
            public void Respond(IGameClient client, ActivityModel activity, GameViewModel state)
            {
                var decklist = client.GetDecklist();

                if (state.Results.Winner == client.PlayerName)
                {
                    foreach (var card in decklist.Where(c => _distribution.Contains(c.Name)))
                    {
                        _distribution.IncreaseLikelihood(card.Name);
                    }
                }
            }
Ejemplo n.º 41
0
        public void Respond(IGameClient client, ActivityModel activity, GameViewModel state)
        {
            var action = state.Hand
                .Where(c => c.Is(CardType.Action))
                .Where(c => AISupportedActions.All.Contains(c.Name))
                .OrderByDescending(c => AISupportedActions.PlusActions.Contains(c.Name))
                .ThenByDescending(c => c.Cost)
                .First();

            var message = new PlayCardMessage(client.PlayerId, action.Id);
            client.AcceptMessage(message);
        }
Ejemplo n.º 42
0
        public void Respond(IGameClient client, ActivityModel activity, GameViewModel state)
        {
            var action = state.Hand
                         .Where(c => c.Is(CardType.Action))
                         .Where(c => AISupportedActions.All.Contains(c.Name))
                         .OrderByDescending(c => AISupportedActions.PlusActions.Contains(c.Name))
                         .ThenByDescending(c => c.Cost)
                         .First();

            var message = new PlayCardMessage(client.PlayerId, action.Id);

            client.AcceptMessage(message);
        }
Ejemplo n.º 43
0
        protected override CardPileViewModel SelectPile(GameViewModel state, IGameClient client)
        {
            var options = GetValidBuys(state)
                .Where(pile => AISupportedActions.All.Contains(pile.Name))
                .OrderByDescending(pile => pile.Cost)
                .ThenBy(pile => _random.Next(100))
                .ToList();

            var message = string.Format("I considered {0}.", string.Join(", ", options.Select(x => x.Name).ToArray()));
            client.SendChatMessage(message);

            return options.FirstOrDefault();
        }
Ejemplo n.º 44
0
        public void Respond(IGameClient client, ActivityModel activity, GameViewModel state)
        {
            var options = activity.ParseOptions();

            Choice choice = options.First();

            if (options.Contains(Choice.Yes))
            {
                choice = Choice.Yes;
            }

            client.AcceptMessage(new ChoiceMessage(client.PlayerId, choice.ToString()));
        }
Ejemplo n.º 45
0
        protected override CardPileViewModel SelectPile(GameViewModel state, IGameClient client)
        {
            var options = GetValidBuys(state)
                          .Where(pile => AISupportedActions.All.Contains(pile.Name))
                          .OrderByDescending(pile => pile.Cost)
                          .ThenBy(pile => _random.Next(100))
                          .ToList();

            var message = string.Format("I considered {0}.", string.Join(", ", options.Select(x => x.Name).ToArray()));

            client.SendChatMessage(message);

            return(options.FirstOrDefault());
        }
Ejemplo n.º 46
0
        protected override void TalkSmack(CardPileViewModel pile, IGameClient client)
        {
            base.TalkSmack(pile, client);

            if (pile.Name == "Province")
            {
                client.SendChatMessage("Province muthafucka!");
            }

            if (pile.Name == "Colony")
            {
                client.SendChatMessage("COLONY! SUCK IT!");
            }
        }
Ejemplo n.º 47
0
        public void Attach(IGameClient client)
        {
            if (_client != null)
            {
                _subscription.Dispose();
            }

            _lastGameStateVersionHandled = 0;
            _lastActivityHandled         = Guid.Empty;

            _client       = client;
            _subscription = client.GameStateUpdates.ObserveOn(Scheduler.NewThread)
                            .Subscribe(Respond);
        }
Ejemplo n.º 48
0
        public override void Initialize(GameContext context)
        {
            base.Initialize(context);

            stringBuilder = new StringBuilder(100, 500);

            gameServer = ServiceLocator.Get<IGameServer>();
            gameClient = ServiceLocator.Get<IGameClient>();

            // Create the connection between the client and server
            gameServer.Start();
            gameClient.Connect();

            startedLoading = false;
            hasRenderedContent = false;
        }
Ejemplo n.º 49
0
        public bool Init(Log.on_log on_log, ISockCallee callee)
        {
            Log.SetLogCallBack(on_log);
            m_gameClient = new GameClient();
            if (m_localClient == null)
            {
                m_localClient = new GameClient();
            }
            m_gameSock = new GameSock();
            if (!m_gameSock.Init(callee))
            {
                return(false);
            }

            ((GameReceiver)m_gameSock.GetGameReceiver()).SetGameClient((GameClient)m_gameClient);
            return(true);
        }
Ejemplo n.º 50
0
	// Use this for initialization
	void Start () {
		if (url.StartsWith ("local")) {
			gameClient = new LocalGameClient ();
		} else {
			gameClient = new GameClient (url);
		}
		gameClient.onConnected += GameClient_onConnected;
		gameClient.onLevelWon += GameClient_onLevelWon;
		gameClient.onEdgeFilled += GameClient_onEdgeFilled;
		gameClient.onNumberOfPlayersChanged += GameClient_onNumberOfPlayersChanged;
		gameClient.onClientError += GameClient_onClientError;
		gameClient.onLevelStarted += GameClient_onLevelStarted;
		gameClient.onLevelLost += GameClient_onLevelLost;
		gameClient.onGameCompleted += GameClient_onGameCompleted;
		gameClient.onGameStarted += GameClient_onGameStarted;
		Debug.Log ("Calling load");
		gameClient.Connect ();
	}
Ejemplo n.º 51
0
        public void Respond(IGameClient client, ActivityModel activity, GameViewModel state)
        {
            var pile = SelectPile(state, client);

            TalkSmack(pile, client);

            IGameActionMessage message = null;

            if (activity.ParseType() == ActivityType.DoBuys)
            {
                message = new BuyCardMessage(client.PlayerId, pile.Id);
            }
            else if (activity.ParseType() == ActivityType.SelectPile)
            {
                message = new ChooseAPileMessage(client.PlayerId, pile == null ? Guid.Empty : pile.Id);
            }

            client.AcceptMessage(message);
        }
Ejemplo n.º 52
0
        public IList<CardViewModel> GetDecklist(IGameClient client)
        {
            _lock.EnterReadLock();
            try
            {
                var player = _players[client];

                var cards = new List<ICard>();
                cards.AddRange(player.Deck.Contents);
                cards.AddRange(player.Discards);
                cards.AddRange(player.Hand);
                cards.AddRange(player.PlayArea);

                return cards
                    .Select(c => new CardViewModel(c))
                    .OrderBy(c => c.Name)
                    .ToList();
            }
            finally
            {
                _lock.ExitReadLock();
            }
        }
 public void Respond(IGameClient client, ActivityModel activity, GameViewModel state)
 {
     var selected = state.Revealed.First();
     client.AcceptMessage(new SelectCardsMessage(client.PlayerId, new[] { selected.Id }));
 }
Ejemplo n.º 54
0
 public void Respond(IGameClient client, ActivityModel activity, GameViewModel state)
 {
     var message = new MoveToBuyStepMessage(client.PlayerId);
     client.AcceptMessage(message);
 }
Ejemplo n.º 55
0
 protected abstract CardPileViewModel SelectPile(GameViewModel state, IGameClient client);
Ejemplo n.º 56
0
 protected override CardPileViewModel SelectPile(GameViewModel state, IGameClient client)
 {
     return state.Bank.Single(p => p.Is<Potion>());
 }
Ejemplo n.º 57
0
 public string GetPlayerName(IGameClient client)
 {
     return client == FirstClient ? FirstGamerName : SecondGamerName;
 }
Ejemplo n.º 58
0
 public IGameClient GetOpponent(IGameClient gameClient)
 {
     if (_clients.Contains(gameClient))
         return _clients.FirstOrDefault(x => x != gameClient);
     else
         throw new Exception("Critical error! Opponent wasn't found!");
 }
Ejemplo n.º 59
0
    public void SetGameClientPlugin(IGameClient gameClient)
    {
        if (GameClientPlugin != gameClient)
        {
            GameData.Load();
            var dataSlot = GameData.current.GetCurrentDataSlot();

            GameClientPlugin = gameClient;
            GameClientPlugin.Initialize(this, dataSlot);
        }
    }
Ejemplo n.º 60
0
 protected virtual void TalkSmack(CardPileViewModel pile, IGameClient client)
 {
     
 }