Last schema refactoring.

This commit is contained in:
Scott Erickson 2014-08-24 11:19:44 -07:00
parent 78a4000e34
commit 297b3e3e63

View file

@ -101,7 +101,7 @@ ActionSchema = c.object {},
SoundSchema = c.sound({delay: {type: 'number'}}) SoundSchema = c.sound({delay: {type: 'number'}})
_.extend ThangTypeSchema.properties, _.extend ThangTypeSchema.properties,
raw: c.object {title: 'Raw Vector Data'}, raw: c.object {title: 'Raw Vector Data', default: {shapes: {}, containers: {}, animations: {}}},
shapes: c.object {title: 'Shapes', additionalProperties: ShapeObjectSchema} shapes: c.object {title: 'Shapes', additionalProperties: ShapeObjectSchema}
containers: c.object {title: 'Containers', additionalProperties: ContainerObjectSchema} containers: c.object {title: 'Containers', additionalProperties: ContainerObjectSchema}
animations: c.object {title: 'Animations', additionalProperties: RawAnimationObjectSchema} animations: c.object {title: 'Animations', additionalProperties: RawAnimationObjectSchema}
@ -131,19 +131,22 @@ _.extend ThangTypeSchema.properties,
type: 'array' type: 'array'
format: 'thang-color-group' format: 'thang-color-group'
items: {type: 'string'} items: {type: 'string'}
snap: c.object {title: 'Snap', description: 'In the level editor, snap positioning to these intervals.', required: ['x', 'y']}, snap: c.object {title: 'Snap', description: 'In the level editor, snap positioning to these intervals.', required: ['x', 'y'], default: {x: 4, y: 4}},
x: x:
title: 'Snap X' title: 'Snap X'
type: 'number' type: 'number'
description: 'Snap to this many meters in the x-direction.' description: 'Snap to this many meters in the x-direction.'
default: 4
y: y:
title: 'Snap Y' title: 'Snap Y'
type: 'number' type: 'number'
description: 'Snap to this many meters in the y-direction.' description: 'Snap to this many meters in the y-direction.'
default: 4
components: c.array {title: 'Components', description: 'Thangs are configured by changing the Components attached to them.', uniqueItems: true, format: 'thang-components-array'}, ThangComponentSchema # TODO: uniqueness should be based on 'original', not whole thing components: c.array {title: 'Components', description: 'Thangs are configured by changing the Components attached to them.', uniqueItems: true, format: 'thang-components-array'}, ThangComponentSchema # TODO: uniqueness should be based on 'original', not whole thing
ThangTypeSchema.required = ['kind']
ThangTypeSchema.deafult =
raw: {}
ThangTypeSchema.definitions = ThangTypeSchema.definitions =
action: ActionSchema action: ActionSchema
sound: SoundSchema sound: SoundSchema