public HttpResponseMessage PerformDefend(string sessionKey, int gameId, [FromBody] int unitId) { var responseMsg = this.PerformOperation(() => { var userId = UserDataPersister.LoginUser(sessionKey); BattleDataPersister.PerformDefend(userId, gameId, unitId); }); return(responseMsg); }
public HttpResponseMessage PerformAttack(string sessionKey, int gameId, [FromBody] MoveModel move) { var responseMsg = this.PerformOperation(() => { var userId = UserDataPersister.LoginUser(sessionKey); BattleDataPersister.PerformAttack(userId, gameId, move.UnitId, move.Position.X, move.Position.Y); }); return(responseMsg); }