2021-11-04 19:58:37 +00:00
|
|
|
import Item from '../item';
|
|
|
|
|
|
|
|
export default class ItemBuilder {
|
|
|
|
constructor() {
|
|
|
|
this.item = new Item();
|
|
|
|
}
|
|
|
|
|
|
|
|
withID(ID) {
|
|
|
|
this.item.id = ID;
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
withName(name) {
|
|
|
|
this.item.name = name;
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
withDescription(description) {
|
|
|
|
this.item.description = description;
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
isUsable(value) {
|
|
|
|
this.item.usable = value;
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
isTakeable(value) {
|
|
|
|
this.item.takeable = value;
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
withUseCallback(callback) {
|
2021-11-04 21:29:05 +00:00
|
|
|
this.item.addUseCallback(callback);
|
2021-11-04 19:58:37 +00:00
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
withTakeCallback(callback) {
|
2021-11-04 21:29:05 +00:00
|
|
|
this.item.addTakeCallback(callback);
|
2021-11-04 19:58:37 +00:00
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
create() {
|
|
|
|
return this.item;
|
|
|
|
}
|
|
|
|
}
|