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)
-
Player
represents an individual client -
Team
is an actual player with resources and existing structures, but might have multiple operators akaPlayer
-
Room
represents 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
-
ILifeGrid
is 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
-
Vector2
is just a 2D Vector for positions -
LifeTemplate
represents a cell configuration "template" -
StructureTemplate
includes aLifeTemplate
and 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) -
Structure
abstract class buidls onStructureTemplate
but requires a method for checking a structure's integrity (is it still active?) -
server
main()
manages theRoom
instances and also processes socket input, mapping them to a player to invoke an action -
Panel
is a general JSX component (div) that we treat as widget for UI elements. -
TeamPanel
is used to display team details -
StructurePanel
is used to display structure status for a client -
StructureTemplatePanel
is to show building options for the user -
LifeGrid
is 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.