The core functionality of what I'm trying to build is the following:
1. You have a population of people
2. You can allocate that population to different jobs
I've decided to do this with bars that you can drag, while showing the number above it, as shown in the code below.
Code: Select all
allocation = Storage()
allocation.sawyer = 0
allocation.unassigned = 70
screen allocation():
default temp_sawyer = allocation.sawyer
frame:
xpos 10 ypos 10
xsize 200
vbox:
text "Unassigned: " + str(allocation.unassigned)
bar value AnimatedValue(allocation.unassigned, colony.population) style "bar"
text "Sawyer: " + str(temp_sawyer)
bar value ScreenVariableValue("temp_sawyer", colony.population) style "bar"
A. How do I pass the value set back to allocation.sawyer?
B. Since the goal is to have multiple places to allocate people; how do I cause one to detract from another?
I suppose B might be a moderately difficult problem to solve, but perhaps it's been done before?