Permalink
Browse files

adding more shit to types

  • Loading branch information...
1 parent 086f965 commit f6f1bfaa67145f4fcda6466334ef2fbb145ff6d2 @digijin committed Feb 17, 2017
Showing with 19 additions and 4 deletions.
  1. +3 −0 src/Game/Type/Item.js
  2. +9 −2 src/Game/Type/Object.js
  3. +7 −2 src/Game/Type/Order.js
@@ -47,4 +47,7 @@ export default class Item{
this.owner = newOwner;
}
+ getOwner(){
+ return this.owner
+ }
}
@@ -18,8 +18,6 @@ import makeKey from 'Util/makeKey'
export default class Obj{
block: Block;
type: ObjectType;
- character: ?Character
- item: ?Item
rotation: number
constructor(params:{block:Block, type:ObjectType}){
defaults(this, params);
@@ -64,7 +62,16 @@ export default class Obj{
return this.block
}
}
+
+ character: ?Character
+ setCharacter(char:Character){
+ this.character = char
+ }
+ getCharacter(){
+ return this.character
+ }
+ item: ?Item
addItem(item:Item){
this.item = (item)
}
@@ -10,8 +10,6 @@ import {keys, defaults} from 'lodash';
import type Character from 'Game/Type/Character'
import type Item from 'Game/Type/Item'
export default class Order{
- customer: Character;
- worker: ?Character;
item: ?Item;
status: OrderStatusType;
type: ItemType;
@@ -22,6 +20,13 @@ export default class Order{
getData(){
return ItemData.get(this.type)
}
+ customer: Character;
+ getCustomer(){
+ return this.customer;
+ }
+
+
+ worker: ?Character;
addWorker(char:Character){
if(this.worker) throw new Error('order already has worker')
this.worker = char;

0 comments on commit f6f1bfa

Please sign in to comment.