Commit Graph

65 Commits

Author SHA1 Message Date
20561c574c
sliceutil: helpers for mid-slice insert/delete.
Manipulating the hand, deck, etc. is going to use these operations a lot.
2023-04-01 18:49:06 -07:00
99e9e35b1d
Card.Drawn, to give cards a chance to not show up
A card can be shuffled into the deck because of a certain condition, and then that condition could cease to apply. If the card should not be presented to the player, it gets one last chance to hide.

There is currently no direct mechanism for making a card _already in the hand_ disappear if it is not relevant, although there are various ways to implement a Rule to do this.
2023-04-01 18:05:57 -07:00
fd35090b34
Generics tutorial on Rule 2023-04-01 17:56:31 -07:00
d569e77fc9
Fix InsertRandomRange warnings.
I was using the wrong format string.
2023-04-01 14:39:56 -07:00
bcfd42970b
BasicStatsPanel
Implement a stats panel with a name, intro text, and a rule for how to pull stats out of a collection.
2023-04-01 14:38:45 -07:00
b324a39918
Explain generic types and add DebugLevel to Player
This simulation engine is intended for people who are interested in game design, not computer programming -- the engine wants to do all the engine stuff so the simulation can be implemented with less familiarity with the language. Generics, however, are not widely regarded as a "new programmer" thing -- even though they're surprisingly familiar, in the end  (slice-of-T, map-from-K-to-V). So a long comment explaining a bit about what's going on seems warranted.
2023-04-01 13:32:25 -07:00
7f8dcd63d6
Introduce InfoPanel.
InfoPanels are information displays that do not cost actions. One of them (the Prompt) is shown at the main menu; others can be made available as options in the menu, ether on an ongoing basis or for the current/next turn only.
2023-04-01 12:30:39 -07:00
fb5735d5b9
Multiple actions per turn
Allow a pattern of multiple actions per turn. Card options can "refund" an action to the player if they should be free, or zero out the remaining actions if they should force the turn to go directly to the simulation step.
2023-04-01 12:21:42 -07:00
cef0718cba
Cards can be urgent 2023-04-01 12:02:14 -07:00
f8b6b6b376
Start implementing Deck as a distinct type.
Deck does enough stuff it should be its own thing; its internal representation might change to make multiple insertions not quadratic, among other reasons. Currently it just does the obvious stuff, though. Allows inserting cards in random or specific slots and drawing cards. Shuffling a range of the deck comes later.
2023-04-01 11:50:39 -07:00
8153a7c083
Card.Then
Add a callback to the Card interface to be invoked after an option is selected. This will most frequently be used for cards that always want to shuffle themselves back into the deck regardless of the Option selected.
2023-03-27 20:21:57 -07:00
b672dfa9ec
Update readme with basic notes 2023-03-27 00:20:54 -07:00
8a2664c305
Delay rules updates during rule execution.
Any RuleCollection change while the rule collection is running a turn is now delayed until all rules are evaluated. This gives consistent semantics for when rule changes invoked my rules themselves are applied.
2023-03-27 00:08:56 -07:00
45bbfe4e8f
Initial commit.
No tests. Not complete.
2023-03-26 23:40:44 -07:00
d820204e7f Initial commit 2023-03-27 06:38:10 +00:00