give myself something to do tomorrow
Matchmaking base
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import Logging from "@proxnet/undead-logging";
|
||||
import Profile from "../profiles.ts";
|
||||
import { IntegratedRoomScene } from "../content/roomtypes.ts";
|
||||
import { IntegratedRoomScene, RoomDetails } from "../content/roomtypes.ts";
|
||||
|
||||
const log = new Logging("Instances");
|
||||
|
||||
@@ -22,6 +22,16 @@ export interface RoomInstance {
|
||||
|
||||
}
|
||||
|
||||
interface InstanceOptions {
|
||||
|
||||
Room: RoomDetails,
|
||||
SceneIndex?: number,
|
||||
EventId?: number,
|
||||
Name?: string,
|
||||
Private?: boolean
|
||||
|
||||
}
|
||||
|
||||
const instancePlayers: Map<RoomInstance, Set<Profile>> = new Map();
|
||||
/**
|
||||
* `Map<roomId (number), RoomInstance>`
|
||||
@@ -91,8 +101,10 @@ class InstancesBase {
|
||||
return this.getInstancePlayers(instance).size < instance.maxCapacity;
|
||||
}
|
||||
|
||||
// add, remove, check for, get profile(s) in instances
|
||||
// synchronize profile.#instance with the profile's current instance (profile.setInstance(RoomInstance)?)
|
||||
createInstance(options: InstanceOptions) {
|
||||
// todo: use room data to create room instance
|
||||
}
|
||||
|
||||
setPlayerInstance(player: Profile, instance: RoomInstance) {
|
||||
const currentInstance = player.getInstance();
|
||||
if (currentInstance === instance) return;
|
||||
|
||||
Reference in New Issue
Block a user