2014-06-30 22:16:26 -04:00
|
|
|
mongoose = require 'mongoose'
|
2016-04-06 13:56:06 -04:00
|
|
|
plugins = require '../plugins/plugins'
|
2014-01-03 13:32:13 -05:00
|
|
|
|
|
|
|
LevelComponentSchema = new mongoose.Schema(
|
|
|
|
original: {type: mongoose.Schema.ObjectId, ref: 'level.session'}
|
|
|
|
majorVersion: Number
|
|
|
|
)
|
|
|
|
|
|
|
|
ThangSoundSchema = new mongoose.Schema(
|
|
|
|
events: [String]
|
|
|
|
actions: [String]
|
|
|
|
files: [String]
|
|
|
|
delay: Number
|
|
|
|
)
|
|
|
|
|
|
|
|
SpriteHueLayer = new mongoose.Schema(
|
|
|
|
name: String
|
|
|
|
hueRange:
|
|
|
|
min: Number
|
|
|
|
max: Number
|
|
|
|
saturationRange:
|
|
|
|
min: Number
|
|
|
|
max: Number
|
|
|
|
brightnessRange:
|
|
|
|
min: Number
|
|
|
|
max: Number
|
|
|
|
)
|
|
|
|
|
|
|
|
LevelThangTypeSchema = new mongoose.Schema()
|
|
|
|
|
|
|
|
LevelThangTypeSchema.add(
|
|
|
|
components: [LevelComponentSchema]
|
|
|
|
description: String
|
|
|
|
media:
|
|
|
|
sounds: [ThangSoundSchema]
|
|
|
|
display:
|
|
|
|
alpha: Number
|
|
|
|
children: [LevelThangTypeSchema]
|
|
|
|
offset: [Number]
|
|
|
|
hueLayers: [SpriteHueLayer]
|
|
|
|
rotation: String
|
|
|
|
scale:
|
|
|
|
both: Number
|
|
|
|
toWorld: Boolean
|
|
|
|
shadow: String
|
|
|
|
width: Number
|
|
|
|
height: Number
|
|
|
|
sheetFromFile:
|
|
|
|
images: [String]
|
|
|
|
frames: [Array]
|
|
|
|
animations: mongoose.Schema.Types.Mixed
|
|
|
|
customSheet:
|
|
|
|
images: [String]
|
|
|
|
frames: [Array]
|
|
|
|
animations: mongoose.Schema.Types.Mixed
|
|
|
|
z: Number
|
|
|
|
image: String
|
|
|
|
)
|
|
|
|
|
|
|
|
LevelThangTypeSchema.plugin(plugins.PermissionsPlugin)
|
|
|
|
LevelThangTypeSchema.plugin(plugins.NamedPlugin)
|
|
|
|
LevelThangTypeSchema.plugin(plugins.SearchablePlugin, {searchable: ['name', 'description']})
|
|
|
|
|
2014-03-11 21:30:25 -04:00
|
|
|
module.exports = LevelThangType = mongoose.model('level.thang.type', LevelThangTypeSchema)
|