conway rts cyber project (but still being designed)
Install bazelisk
bazelisk # installs bazel with specific version
bazel query ... # list targets
bazel test ... --config=cl # run all tests (windows, cl.exe)
bazel test ... --config=gcc # run all tests (linux, gcc)
balze build ... # build all targets (config pattern still applies)
-
Playerrepresents an individual client -
Teamis an actual player with resources and existing structures, but might have multiple operators akaPlayer -
Roomrepresents a game room.Room::initialize()is used to start a game (clear the board and setup player positions)Room::processTick()handles updating the game state to advance a stepRoom::buildStructure()is used to figure out who
-
ILifeGridis the interface for implementing a LifeGrid (grid for Conway's game of life)ILifeGrid::getCell()for querying cells (determine if a structure is still active)ILifeGrid::setCell()for setting individual cells (probably to be private)ILifeGrid::loadTemplate()for loading a template (cell configuration)ILifeGrid::compareTemplate()returns the amount of cells that differ from the templateILifeGrid::step()advances the grid by one generation according to Conway's game of life rules
-
Vector2is just a 2D Vector for positions -
LifeTemplaterepresents a cell configuration "template" -
StructureTemplateincludes aLifeTemplateand various other structure stats (cost, resourceRate - either income or upkeep, buildArea - how much it extends area you can build, visionArea - how much it shows you if we're doing fog of war) -
Structureabstract class buidls onStructureTemplatebut requires a method for checking a structure's integrity (is it still active?) -
server
main()manages theRoominstances and also processes socket input, mapping them to a player to invoke an action -
Panelis a general JSX component (div) that we treat as widget for UI elements. -
TeamPanelis used to display team details -
StructurePanelis used to display structure status for a client -
StructureTemplatePanelis to show building options for the user -
LifeGridis the JS implementation of GameOfLife that pretty much handles everything the server also handles. We might use a second LifeGrid as a "future preview" so user can see what happens more intuitively.
