Commit Graph

40 Commits

Author SHA1 Message Date
0f21020647
More fencepost errors! 2023-04-02 19:08:26 -07:00
e96d81a7b4
Fencepost error!
Also the title is visible.
2023-04-02 19:07:05 -07:00
3a7bf9c2fb
Don't adjust twice. 2023-04-02 19:05:15 -07:00
00ea284cbc
Nil is not an error, much less a serious one. 2023-04-02 19:03:39 -07:00
2480a1631b
Implement a very crude "game" as a test. Also updates Player. 2023-04-02 19:01:40 -07:00
2875dc5af8
Implement review mode.
This finishes the UI.
2023-04-02 13:58:56 -07:00
74ca51b21d
actions mode, prompt cleanup
Fixes some off-by-one errors. A 1-indexed UI in a 0-indexed language is always going to be prone to those and I will no doubt find more when I have enough of a test program to experiment with...
2023-04-02 13:19:26 -07:00
5a2158f525
Implement Stats Mode.
Also rewords some prompts. Might as well be thorough in accepting reasonable inputs.
2023-04-02 12:54:52 -07:00
25a9eed3f0
Prompt for player choices on cards.
Also handles errors in the display/prompt logic somewhat better.
2023-04-02 12:44:29 -07:00
592c877852
More display components. 2023-04-02 00:43:17 -07:00
e1eac9de0f
displayStatsMenu 2023-04-02 00:36:12 -07:00
7371cddab3
Add more dividers 2023-04-02 00:28:34 -07:00
aecd8683b2
Restructure loop, basic display functions 2023-04-02 00:26:34 -07:00
a62de999ea
Panel display, MultiMessage. 2023-04-02 00:20:37 -07:00
3eb087201f
more terminal utility functions 2023-04-02 00:09:17 -07:00
c73545fd07
Implement screen clear. 2023-04-02 00:02:25 -07:00
34e1f3166f
Main display mode skeleton 2023-04-01 23:59:53 -07:00
af9d9a6579
Skeleton of prototypical UI. 2023-04-01 23:22:50 -07:00
9e659ecf41
InitPlayer
InitPlayer creates very not-ready Player with its basic data structures initialized to an empty, ready-for-data state.
2023-04-01 22:19:42 -07:00
09fdf19948
CardOption.Enable
Make it possible for a card to display an option but not actually allow it to be selected. It's up to the UI layer to decide how to display options that are not enabled. The option text should probably contiain a note on why the option cannot be selected...
2023-04-01 22:09:05 -07:00
45e1eeebf7
Play cards. 2023-04-01 21:18:48 -07:00
576a2dd69e
Implement drawing and running a turn. 2023-04-01 20:52:46 -07:00
a6b2c92f86
Comment and reorganize Player. 2023-04-01 20:04:20 -07:00
75de281cee
Refactor Strip (already).
Stripping cards from the Hand will also be useful, so I pulled the logic of Strip out into arrayutil (more efficiently, too) and rewrote deck.Strip to use it.
2023-04-01 19:40:28 -07:00
222d4375ee
deck.Strip -- remove cards
Given a function that identifies cards to remove, remove them from the deck. This can be used to find and strip out cards that are only conditionally appropriate (and aren't appropriate anymore).
2023-04-01 19:31:50 -07:00
b806264154
Fraction-specified shufflers.
Convenience methods for "shuffle the bottom third of the deck" and stuff like that.
2023-04-01 19:23:14 -07:00
b8c0e5603a
Add a general shuffler and deck shuffling. 2023-04-01 19:13:42 -07:00
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
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