Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- union UGeometry { Polygon, Point, Linestring }
- table Point {
- point:Vec2;
- }
- table Polygon {
- points:[Vec2List];
- }
- table Geometry {
- g:UGeometry;
- }
- var rawPolygon = flatBufGeometry.g( new storage.Polygon() );
- rawPolygon = rawGeometry.G()(storage.Polygon.Polygon())
- union Equipment { Weapon } // Optionally add more tables.
- table Monster {
- pos:Vec3;
- mana:short = 150;
- hp:short = 100;
- name:string;
- friendly:bool = false (deprecated);
- inventory:[ubyte];
- color:Color = Blue;
- weapons:[Weapon];
- equipped:Equipment;
- path:[Vec3];
- }
- table Weapon {
- name:string;
- damage:short;
- }
- root_type Monster;
- import MyGame.Sample.Equipment
- import MyGame.Sample.Weapon
- union_weapon = MyGame.Sample.Weapon.Weapon()
- union_weapon.Init(monster.Equipped().Bytes, monster.Equipped().Pos)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement