Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. union UGeometry { Polygon, Point, Linestring }
  2.  
  3. table Point {
  4. point:Vec2;
  5. }
  6.  
  7. table Polygon {
  8. points:[Vec2List];
  9. }
  10.  
  11. table Geometry {
  12. g:UGeometry;
  13. }
  14.  
  15. var rawPolygon = flatBufGeometry.g( new storage.Polygon() );
  16.  
  17. rawPolygon = rawGeometry.G()(storage.Polygon.Polygon())
  18.  
  19. union Equipment { Weapon } // Optionally add more tables.
  20.  
  21.  
  22. table Monster {
  23. pos:Vec3;
  24. mana:short = 150;
  25. hp:short = 100;
  26. name:string;
  27. friendly:bool = false (deprecated);
  28. inventory:[ubyte];
  29. color:Color = Blue;
  30. weapons:[Weapon];
  31. equipped:Equipment;
  32. path:[Vec3];
  33. }
  34.  
  35. table Weapon {
  36. name:string;
  37. damage:short;
  38. }
  39.  
  40. root_type Monster;
  41.  
  42. import MyGame.Sample.Equipment
  43. import MyGame.Sample.Weapon
  44.  
  45. union_weapon = MyGame.Sample.Weapon.Weapon()
  46. union_weapon.Init(monster.Equipped().Bytes, monster.Equipped().Pos)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement