mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-20 17:40:33 +00:00
created PlayerType enum add FakeHuman type
This commit is contained in:
+4
-1
@@ -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(),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user