ludo-web-multiplayer/backend/schemas/player.js
2023-11-18 20:49:42 +01:00

17 lines
364 B
JavaScript

const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const PlayerSchema = new Schema({
name: String,
color: String,
ready: { type: Boolean, default: false },
nowMoving: { type: Boolean, default: false },
});
PlayerSchema.methods.changeReadyStatus = function () {
this.ready = !this.ready;
};
module.exports = PlayerSchema;