CabinGame/Luxe/blocks/adventures.wren

55 lines
1,006 B
Text
Raw Normal View History

2020-09-19 14:06:46 +00:00
import "math/observable" for Observable
import "luxe: world" for Entity, Values, Tags
2020-09-19 20:38:55 +00:00
import "globals" for Globals
2020-09-19 14:06:46 +00:00
class Adventures{
planning{_planning}
construct new(){
_planning = Observable.new()
_in_progress = []
_archive = []
}
plan_new(){
2020-09-19 20:38:55 +00:00
var adventure = Adventure.new()
2020-09-19 14:06:46 +00:00
_planning.value = adventure
return adventure
}
new_or_current(){
if(_planning.value) return _planning.value
return plan_new()
}
discard(){
_planning.value = null
}
2020-09-19 20:38:55 +00:00
}
class Adventure{
adventurers{_adventurers}
resources{_resources}
data{_data}
2020-09-25 08:42:41 +00:00
direction{_direction}
direction=(dir){_direction = dir}
distance{_distance}
distance=(dist){_distance = dist}
2020-09-19 20:38:55 +00:00
construct new(){
_adventurers = []
_resources = []
_data = {}
2020-09-25 08:42:41 +00:00
_direction = 0
_distance = 0
2020-09-19 20:38:55 +00:00
}
add_adventurer(adventurer){
_adventurers.add(adventurer)
}
add_resource(resource){
_resources.add(resource)
}
2020-09-19 14:06:46 +00:00
}