Crate liquidwar7core

Crate liquidwar7core 

Source

Modules§

chunks
Chunked network transfer utilities.
quad_mesh
Quadtree-based mesh for optimized gradient computation.

Structs§

Armies
Manages all fighters across all teams in the game.
Color
Represents an RGB color with floating-point components.
Cursor2D
A 2D cursor with x and y coordinates.
Cursor3D
A 3D cursor with x, y, and z coordinates.
Fighter
Represents an individual fighter unit on the battlefield.
GameHandler
Handles game timing and processing logic. Wraps a GameState and manages fixed timestep updates.
Grid
A simple 3D grid for fighter occupation tracking.
StepTiming
Accumulated timing for game step phases.
Team
World
The central game state containing all game entities.

Enums§

FighterStatus
The current status of a fighter on the battlefield.
SpawnError
Error type for spawn operations.

Constants§

ACTION_POINTS_PER_STEP
Action points added to each fighter per step.
BEIGE
Warm beige/tan - earthy neutral, distinct from yellow (hue ~40°).
BLUE
Deep blue - rich and distinct from sky/cyan (hue 240°).
CYAN
Aqua cyan - blue-green, bright and fresh (hue 180°).
DEFAULT_ATTACK_FACTOR
Default attack factor: health lost by enemy per attack.
DEFAULT_CONVERT_FACTOR
Default convert factor: health of a fighter when converted to attacker’s team.
DEFAULT_HEAL_FACTOR
Default heal factor: health gained by ally per heal.
DEFAULT_X
Default x offset for centering entities within a cell.
DEFAULT_Y
Default y offset for centering entities within a cell.
DEFAULT_Z
Default z coordinate for 2D worlds.
GREEN
Pure green - classic green (hue 120°).
LIME
Electric lime - yellow-green, clearly not pure green (hue ~80°).
MAGENTA
Hot magenta - red-purple, distinct from both red and purple (hue ~320°).
MAX_TEAM_OCCUPATION
Maximum fraction of walkable cells a single team can occupy (40%). Spawning is refused if this limit would be exceeded.
MIN_GRADIENT_INCREMENT
Minimum gradient increment for spreading (base value).
MOVE_COST
Cost of a single move action (in action points).
ORANGE
Vibrant orange - warm and energetic (hue ~30°).
PINK
Warm pink - lighter red variant, clearly pink not red (hue ~350°).
PURPLE
Vivid purple - Valérie’s favorite! (hue ~270°).
RED
Pure red - bold and unmistakable (hue 0°).
SIMULATION_BATTLEFIELD_DEPTH
Depth of the default battlefield (3 user-defined layers + 1 ground = 4)
SIMULATION_BATTLEFIELD_HEIGHT
Height of the default battlefield (108 rows)
SIMULATION_BATTLEFIELD_WIDTH
Width of the default battlefield (192 columns)
SIMULATION_TEXT_LAYERS
Number of user-defined layers in the text maze (3)
SKY
Sky blue - lighter blue variant, airy (hue ~200°).
YELLOW
Bright yellow - maximum visibility (hue 60°).

Traits§

Cursor
A cursor represents a player’s position on the battlefield.
GameState
Trait for game state that can be advanced by steps.

Functions§

all_colors
Returns an iterator over all 12 palette colors.
create_default_simulation
Creates a default simulation with the hardcoded maze.
default_simulation_maze
Returns the hardcoded maze map as a string. The maze is 192 columns * 108 rows * 3 layers deep (from simulation-{0,1,2}.png) ‘#’ represents walls, ’ ’ represents walkable areas. Layers are separated by lines of ‘-’ characters. Features the original Liquid War game (by Thom-Thom) on the left and a maze on the right.
min_gradient_increment_from_steps_count
Computes a varying minimum gradient increment based on step count.
repr_world_armies
Represents a world with its armies as a string.
repr_world_armies_and_cursors
Represents a world with armies and cursors as a string.
repr_world_mesh
Represents a world mesh as a string.
repr_world_with_gradient
Represents a world mesh with a custom gradient as a string.
repr_world_with_team_gradient
Represents a world mesh with a team’s gradient as a string.