Artifact [9b26e1784e]
Not logged in

Artifact 9b26e1784e12b5f2c97699ff64a2325afad617d9:


package im.bci.newtonadv.nal;

option java_outer_classname = "NewtonAdventureLevelParser";

message AnimationReference {
    required string file = 1;
    optional string name = 2;
}

message Circle {
    required float size = 1;
}

message Rectangle {
    required float width = 1;
    required float height = 2;
}

message Vertex {
    required float x = 1;
    required float y = 2;
}

message ConvexPolygon {
    repeated Vertex vertices = 1;
}

message Shape {
    optional Circle circle = 1;
    optional Rectangle rectangle = 2;
    optional ConvexPolygon polygon = 3;
}

message Position {
    required float x = 1;
    required float y = 2;
}

message Path {
    repeated Position positions = 1;
}

message Phys2dBodyParameters {
    optional bool enabled = 1;
    optional bool rotatable = 2;
    optional bool moveable = 3;
    optional bool can_rest = 4;
    optional bool gravity_effected = 5;
    optional float mass = 6;
    optional float restitution = 7;
    optional float friction = 8;
    optional float damping = 9;
    optional float rot_damping = 10;
}

message Pikes {
    enum DangerousSide {
            UP = 1;
            DOWN = 2;
            LEFT = 3;
            RIGHT = 4;
    }
    required DangerousSide dangerous_side = 1;
    optional AnimationReference animation = 2;
    optional Phys2dBodyParameters phys2d = 3;
}

message Platform {
    optional AnimationReference animation = 1;
    optional Phys2dBodyParameters phys2d = 2;
}

message BouncePlatform {
    optional AnimationReference animation = 1;
    optional Phys2dBodyParameters phys2d = 2;
}

message Cannon {
    enum Orientation {
            UP = 1;
            DOWN = 2;
            LEFT = 3;
            RIGHT = 4;
    }
    required Orientation orientation = 1;
    optional AnimationReference animation = 2;
}

message Mummy {
    required AnimationReference animation = 1;
    optional Phys2dBodyParameters phys2d = 2;
}


message Bat {
    required AnimationReference animation = 1;
    optional Phys2dBodyParameters phys2d = 2;
}

message Apple {
    required AnimationReference animation = 1;
}

message Coin {
    required AnimationReference animation = 1;
}

message Key {
    required AnimationReference animation = 1;
    optional Phys2dBodyParameters phys2d = 2;
}

message Door {
    required AnimationReference open_animation = 1;
    required AnimationReference closed_animation = 2;
}

message DoorToBonusWorld {
    required AnimationReference open_animation = 1;
    required AnimationReference closed_animation = 2;
}

message Cloud {
    required AnimationReference animation = 1;
    optional Phys2dBodyParameters phys2d = 2;
}

message WorldMap {
    required AnimationReference animation = 1;
}

message Compass {
    required AnimationReference animation = 1;
}

message MobilePikeAnchor {
    message Anchor {
        required AnimationReference animation = 1;
        optional Phys2dBodyParameters phys2d = 2;
    }
    message Mobile {
        required AnimationReference animation = 1;
        optional Phys2dBodyParameters phys2d = 2;
    }
    required Anchor anchor = 1;
    required Mobile mobile = 2;
}

message AxeAnchor {
    message Anchor {
        required AnimationReference animation = 1;
        optional Phys2dBodyParameters phys2d = 2;
    }
    message Mobile {
        required AnimationReference animation = 1;
        optional Phys2dBodyParameters phys2d = 2;
    }
    required Anchor anchor = 1;
    required Mobile mobile = 2;
}

message Activator {
    required int32 activableId = 1;
    required AnimationReference on_animation = 2;
    required AnimationReference off_animation = 3;
    optional Phys2dBodyParameters phys2d = 4;
}

message MemoryActivator {
    required int32 activableId = 1;
    required AnimationReference on_animation = 2;
    required AnimationReference off_animation = 3;
    required AnimationReference hide_animation = 4;
    optional Phys2dBodyParameters phys2d = 5;
}

message Blocker {
    required int32 activableId = 1;
    required AnimationReference animation = 2;
    optional Phys2dBodyParameters phys2d = 3;
}

message MovingPlatform {
    required AnimationReference animation = 1;
    required Path path = 2;
    optional Phys2dBodyParameters phys2d = 3;
}

message Teleporter {
    required AnimationReference animation = 1;
    required string color = 2;
}

message KeyLock {
    required AnimationReference animation = 1;
    optional Phys2dBodyParameters phys2d = 2;
}

message HelpSign {
    required AnimationReference animation = 1;
}

message EgyptianBoss {
    required AnimationReference body_animation = 1;
    required AnimationReference hand_animation = 2;
}

message Hero {
    required AnimationReference animation = 1;
    optional Phys2dBodyParameters phys2d = 2;
}

message EntityType {
    required string name = 1;
    required Shape shape = 2;
    optional Pikes pikes = 3;
    optional Platform platform = 4;
    optional BouncePlatform bounce_platform = 5;
    optional Cannon cannon = 6;
    optional Mummy mummy = 7;
    optional Bat bat = 8;
    optional Apple apple = 9;
    optional Coin coin = 10;
    optional Key key = 11;
    optional Door door = 12;
    optional DoorToBonusWorld door_to_bonus_world = 13;
    optional Cloud cloud = 14;
    optional WorldMap world_map = 15;
    optional Compass compass = 16;
    optional MobilePikeAnchor mobile_pike_anchor = 17;
    optional AxeAnchor axe_anchor = 18;
    optional Activator activator = 19;
    optional MemoryActivator memory_activator = 20;
    optional MovingPlatform moving_platform = 21;
    optional Teleporter teleporter = 22;
    optional KeyLock keyLock = 23;
    optional HelpSign help_sign = 24;
    optional EgyptianBoss egyptian_boss = 25;
    optional Hero hero = 26;
    optional Blocker blocker = 27;
}

message Entity {
    required string type = 1;
    required Position position = 2;
    required int32 zorder = 3;
}

message Level {
    repeated EntityType entity_types = 1;
    repeated Entity entities = 2;
    required bool rotate_gravity_possible = 3;	
}