Files
familyARK/familyark/app/model/animal.js
T
2019-11-30 06:20:07 +00:00

35 lines
1.5 KiB
JavaScript

const mongoose = require('mongoose'),
animalModel = new mongoose.Schema({
uuid: mongoose.Schema.Types.String,
name: mongoose.Schema.Types.String,
specie: {type: mongoose.Schema.Types.ObjectId, ref: 'species'},
sex: mongoose.Schema.Types.String,
photo: mongoose.Schema.Types.String,
user: {type: mongoose.Schema.Types.ObjectId, ref: 'user'},
initial_level: mongoose.Schema.Types.Number,
level: mongoose.Schema.Types.Number,
description: mongoose.Schema.Types.String,
initial_health: mongoose.Schema.Types.Decimal128,
initial_energy: mongoose.Schema.Types.Decimal128,
initial_oxigen: mongoose.Schema.Types.Decimal128,
initial_food: mongoose.Schema.Types.Decimal128,
initial_damage: mongoose.Schema.Types.Decimal128,
initial_velocity: mongoose.Schema.Types.Decimal128,
health: mongoose.Schema.Types.Decimal128,
energy: mongoose.Schema.Types.Decimal128,
oxigen: mongoose.Schema.Types.Decimal128,
food: mongoose.Schema.Types.Decimal128,
damage: mongoose.Schema.Types.Decimal128,
velocity: mongoose.Schema.Types.Decimal128,
inconsistency: mongoose.Schema.Types.Decimal128,
imprint: mongoose.Schema.Types.Decimal128,
father: {type: mongoose.Schema.Types.ObjectId, ref: 'animal'},
mother: {type: mongoose.Schema.Types.ObjectId, ref: 'animal'},
mutations: mongoose.Schema.Types.Number,
server: mongoose.Schema.Types.String,
base: mongoose.Schema.Types.String,
breeder: mongoose.Schema.Types.String
})
module.exports = db => db.model('animal', animalModel)