Rename CreateAutoTeam req/res

This commit is contained in:
Tau
2019-11-06 17:28:29 -05:00
parent 697ed5f58d
commit 18654f1459
14 changed files with 45 additions and 45 deletions
+6 -6
View File
@@ -1,15 +1,15 @@
import { Id } from "../model/base";
import { Team } from "../model/team";
import { CreateTeamRequest } from "../request/createTeam";
import { JoinAutoTeamRequest } from "../request/joinAutoTeam";
import { LoadTeamRequest } from "../request/loadTeam";
import { CreateTeamResponse } from "../response/createTeam";
import { JoinAutoTeamResponse } from "../response/joinAutoTeam";
import { LoadTeamResponse } from "../response/loadTeam";
import { World } from "../world";
export function _team(
w: World,
req: CreateTeamRequest | LoadTeamRequest
): CreateTeamResponse | LoadTeamResponse {
req: JoinAutoTeamRequest | LoadTeamRequest
): JoinAutoTeamResponse | LoadTeamResponse {
const bits = {
team: {
id: 2 as Id<Team>,
@@ -18,8 +18,8 @@ export function _team(
members: [],
};
if (req.type === "create_team_req") {
return { type: "create_team_res", ...bits };
if (req.type === "join_auto_team_req") {
return { type: "join_auto_team_res", ...bits };
} else {
return { type: "load_team_res", ...bits };
}
+1 -1
View File
@@ -38,7 +38,7 @@ export async function dispatch(w: World, req: Request): Promise<Response> {
case "create_profile_req":
return createProfile(w, req);
case "create_team_req":
case "join_auto_team_req":
return _team(w, req);
case "load_2on2_req":