CabinGame/Luxe/blocks/adventures.wren
2020-09-19 22:38:55 +02:00

48 lines
No EOL
843 B
Text

import "math/observable" for Observable
import "luxe: world" for Entity, Values, Tags
import "globals" for Globals
class Adventures{
planning{_planning}
construct new(){
_planning = Observable.new()
_in_progress = []
_archive = []
}
plan_new(){
var adventure = Adventure.new()
_planning.value = adventure
return adventure
}
new_or_current(){
if(_planning.value) return _planning.value
return plan_new()
}
discard(){
_planning.value = null
}
}
class Adventure{
adventurers{_adventurers}
resources{_resources}
data{_data}
construct new(){
_adventurers = []
_resources = []
_data = {}
}
add_adventurer(adventurer){
_adventurers.add(adventurer)
}
add_resource(resource){
_resources.add(resource)
}
}