created PlayerType enum add FakeHuman type

This commit is contained in:
evanpelle
2024-09-06 17:55:12 -07:00
parent 0bc78d07eb
commit 4caaaea140
10 changed files with 30 additions and 20 deletions
+4 -1
View File
@@ -1,4 +1,5 @@
import {z} from 'zod';
import {PlayerType} from './Game';
export type GameID = string
export type ClientID = string
@@ -24,6 +25,8 @@ export type ClientIntentMessage = z.infer<typeof ClientIntentMessageSchema>
export type ClientJoinMessage = z.infer<typeof ClientJoinMessageSchema>
export type ClientLeaveMessage = z.infer<typeof ClientLeaveMessageSchema>
const PlayerTypeSchema = z.nativeEnum(PlayerType);
// TODO: create Cell schema
export interface Lobby {
@@ -53,7 +56,7 @@ export const AttackIntentSchema = BaseIntentSchema.extend({
export const SpawnIntentSchema = BaseIntentSchema.extend({
type: z.literal('spawn'),
name: z.string(),
isBot: z.boolean(),
playerType: PlayerTypeSchema,
x: z.number(),
y: z.number(),
})