-
-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dict and dict operations #68
Comments
I was always unsure about adding a dict-type, because it may have <gmanvoice> unforseen consequences </gmanvoice>: I guess that we should add dicts, though. Intuitively they seem a good addition, and loosing non-object values is probably okay, because who cares for a So all in all I think you are right and we should add a dict-type. |
Yes but its huge Something():
FoodCost(ResourceAmount):
resource: Food
amount: 50
WoodCost(ResourceAmount):
resource: Wood
amount: 50
cost: {FoodCost, WoodCost} My first thought was some kind of an anonymous object, but then you have something that cannot be referenced so why not just dicts. Also having a bunch of prebuild WoodCost50, WoodCost75 but again you cannot patch them. Maybe having a way to inline it, but then it gets ugly... |
Yea indeed, so let's go for |
For openage dicts will be very useful in order to deal with what in the engine are called
ResourceBundle
.In nyan creating a set of something like ResourceAmount would be very verbose, but with
dict(Resource, float)
a collection of resources can encoded very nicely:However, there is a need to be able to access the dict values separately. I would suggest something like that:
Sidenote: Time (training time) could also be modeled as a Resource and be included in the cost
The text was updated successfully, but these errors were encountered: