Skip to content

Commit

Permalink
feat: add getCurrentCoolantLevel function to HTTP api
Browse files Browse the repository at this point in the history
  • Loading branch information
Tuhis committed Jan 28, 2024
1 parent ad1936a commit 7e222e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/spaceObjects/playerSpaceship.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,9 @@ REGISTER_SCRIPT_SUBCLASS(PlayerSpaceship, SpaceShip)
/// All SpaceObjects within this radius are dealt damage upon self-destruction.
/// Example: ship:getSelfDestructSize()
REGISTER_SCRIPT_CLASS_FUNCTION(PlayerSpaceship, getSelfDestructSize);
/// Returns current coolant level of a system.
/// Example: player:getCurrentCoolantLevel("Reactor")
REGISTER_SCRIPT_CLASS_FUNCTION(PlayerSpaceship, getCurrentCoolantLevel);
}

static const int16_t CMD_TARGET_ROTATION = 0x0001;
Expand Down
1 change: 1 addition & 0 deletions src/spaceObjects/playerSpaceship.h
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ class PlayerSpaceship : public SpaceShip
void setMaxCoolant(float coolant);
float getMaxCoolant() { return max_coolant; }
void setAutoCoolant(bool active) { auto_coolant_enabled = active; }
float getCurrentCoolantLevel(ESystem system) { return systems[system].coolant_level; }
int getRepairCrewCount();
void setRepairCrewCount(int amount);
EAlertLevel getAlertLevel() { return alert_level; }
Expand Down

0 comments on commit 7e222e1

Please sign in to comment.