void ReadPlayersInput()
        {
            ComponentMessageBase message;

            while (server.TryDequeuePlayerAction(out BasePlayerAction action))
            {
                if (
                    action.actionType == PlayerActionType.PlayerChangeAngle ||
                    action.actionType == PlayerActionType.SkillLMB ||
                    action.actionType == PlayerActionType.SkillRMB
                    )
                {
                    message = new ComponentMessageAngle((ComponentMessageType)action.actionType, action.newAngle);
                }
                else
                {
                    message = new ComponentMessageBase((ComponentMessageType)action.actionType);
                }

                players.Find((p) => p.Id == action.playerId)?.
                SendMessage(message);
            }
        }
Beispiel #2
0
 void ProcessAngleChanged(ComponentMessageAngle msg)
 {
     Angle           = msg.Angle;
     Owner.IsUpdated = true;
 }