Guest User

Untitled

a guest
Mar 18th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. import { define, Record } from 'type-r';
  2.  
  3. @define
  4. export class Box extends Record {
  5. static attributes = {
  6. x : Number,
  7. y : Number,
  8. location : String
  9. }
  10.  
  11. get area() {
  12. return this.x * this.y;
  13. }
  14. }
  15.  
  16. @define
  17. export class Arrow extends Record {
  18. static attributes = {
  19. from : Box.from( '~boxes' ),
  20. to : Box.from( '~boxes' )
  21. }
  22. }
Add Comment
Please, Sign In to add comment