The host begins at every table size and may send a bot away
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0141G6xqLeNRYEtviLWSB5Up
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
457a536f58
commit
ddb18cb08a
@@ -104,6 +104,11 @@ export class Room {
|
||||
return this.act(() => api.addBot(this.roomId, this.token), 'The bot could not be seated.');
|
||||
}
|
||||
|
||||
/** Send a bot away before the game begins; only the host may. */
|
||||
unseat(seat: SeatId): Promise<boolean> {
|
||||
return this.act(() => api.unseat(this.roomId, this.token, seat), 'The bot could not be sent away.');
|
||||
}
|
||||
|
||||
say(text: string): Promise<boolean> {
|
||||
if (this.spectating) return Promise.resolve(false);
|
||||
return this.act(() => api.say(this.roomId, this.token, text), 'The table did not hear you.');
|
||||
@@ -125,11 +130,12 @@ export class Room {
|
||||
return new Room(seated.view, seated.token);
|
||||
}
|
||||
|
||||
/** A room with a bot already seated, so a solo game is a ledger like any other. */
|
||||
/** A room with a bot seated and the game begun, so a solo game is a ledger like any other. */
|
||||
static async createWithBot(name: string): Promise<Room> {
|
||||
const seated = await api.create(name, 2);
|
||||
rememberSeat(seated.view.roomId, { seat: seated.seat, token: seated.token });
|
||||
return new Room(await api.addBot(seated.view.roomId, seated.token), seated.token);
|
||||
await api.addBot(seated.view.roomId, seated.token);
|
||||
return new Room(await api.begin(seated.view.roomId, seated.token), seated.token);
|
||||
}
|
||||
|
||||
static async join(roomId: string, name: string): Promise<Room> {
|
||||
|
||||
Reference in New Issue
Block a user