Beispiel #1
0
        public override void ProcessOpponentAction(EndTurnAction action)
        {
            var position = new Position {
                X = -1, Y = -1
            };
            var actionMessage = new ProtoAction {
                From = position, To = position, Id = action.getId()
            };
            var wrapperMessage = new WrapperMessage {
                Action = actionMessage
            };

            ConnectionHandler.Instance.SendWebsocketMessage(wrapperMessage);
        }
Beispiel #2
0
        public override void ProcessOpponentAction(TargetableAction action)
        {
            var actionMessage = new ProtoAction
            {
                From = action.getContext().source.ToPosition(),
                To   = action.getContext().target.ToPosition(),
                Id   = ((Action)action).getId()
            };
            var wrapperMessage = new WrapperMessage {
                Action = actionMessage
            };

            ConnectionHandler.Instance.SendWebsocketMessage(wrapperMessage);
        }
Beispiel #3
0
        private void ProcessMessage(ProtoAction protoAction)
        {
            var from = new Point(-1, -1);
            var to   = new Point(-1, -1);

            if (protoAction.From != null)
            {
                from = protoAction.From.ToKernelPosition();
            }
            if (protoAction.To != null)
            {
                to = protoAction.To.ToKernelPosition();
            }

            battle.PerformAction(from, to, protoAction.Id);
        }