A full stack implementation of the board game OneNightUltimate
andimeo / onenightultimate Goto Github PK
View Code? Open in Web Editor NEWA full stack implementation of the board game OneNightUltimate
License: Apache License 2.0
A full stack implementation of the board game OneNightUltimate
License: Apache License 2.0
front->end:
{
type: "DO_ENTER",
name: "ZhangChee"
}
end->front:
{
type: "CONFIRM_ENTER",
isHost: true
}
front->end:
{
type: "FINISH_SELECTION",
selectedIndexes: [1,3,5,6]
}
front->end:
{
type: "RESTART_GAME"
}
end->front:
{
type: "GAME_START",
players: [
{name: "name1"},
{name: "name2"},
{name: "name3"},
{name: "name4"},
{name: "name5"},
{name: "name6"},
{name: "name7"},
{name: "name8"},
],
myInfo: {
index: 3,
role: "强盗"
}
}
Each API represents an operation.
In each API, we only convert the arguments into an instance of Operation and pass it to the CardDeck which maintains the current gaming status.
The function of the role to handle this operation should return a status, OPERATING or END (because a role like a witch has to interact with server twice during her round, see one of the center cards and swap it with another player).
Besides the status, the function should also return, if any, the information shown to the client.
Then, CardDeck will write the message to the corresponding websocket.
After the status of all roles in RoleRegistry hit END, the game ends and start voting.
When all votes received or the time limit is hit, show the final result to the client.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.