first commit
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
package com.xuezhanmaster.game.domain;
|
||||
|
||||
import com.xuezhanmaster.game.event.GameEvent;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
public class GameSession {
|
||||
|
||||
private final String gameId;
|
||||
private final String roomId;
|
||||
private final Instant createdAt;
|
||||
private final GameTable table;
|
||||
private final List<GameEvent> events;
|
||||
|
||||
public GameSession(String roomId, GameTable table) {
|
||||
this.gameId = UUID.randomUUID().toString();
|
||||
this.roomId = roomId;
|
||||
this.createdAt = Instant.now();
|
||||
this.table = table;
|
||||
this.events = new ArrayList<>();
|
||||
}
|
||||
|
||||
public String getGameId() {
|
||||
return gameId;
|
||||
}
|
||||
|
||||
public String getRoomId() {
|
||||
return roomId;
|
||||
}
|
||||
|
||||
public Instant getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
public GameTable getTable() {
|
||||
return table;
|
||||
}
|
||||
|
||||
public List<GameEvent> getEvents() {
|
||||
return events;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user