Beispiel #1
0
        public bool ObjectAction(string userId, string targetId, ObjectActionType actionType)
        {
            var targetSession = gameData.GetSessionByUserId(userId);

            if (targetSession == null)
            {
                return(false);
            }

            var character = gameData.GetCharacterByUserId(userId);

            if (character == null)
            {
                return(false);
            }

            gameData.Add(gameData.CreateSessionEvent(
                             GameEventType.PlayerAction,
                             targetSession,
                             new PlayerAction()
            {
                UserId     = userId,
                TargetId   = targetId,
                ActionType = (int)actionType,
            }
                             ));

            return(true);
        }
Beispiel #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DepartmentActionModel" /> class.
 /// </summary>
 /// <param name="id">id.</param>
 /// <param name="name">name.</param>
 /// <param name="actionType">actionType.</param>
 public DepartmentActionModel(int id = default(int), string name = default(string), ObjectActionType actionType = default(ObjectActionType))
 {
     this.Id         = id;
     this.Name       = name;
     this.ActionType = actionType;
 }