AFTN.Game_stateTracking the state of the currently-running game
type state = {map : Map.map;Game map
*)num_scrap : Map.room -> int;How much scrap is in this room
has_event : Map.room -> bool;Whether the room has an event
room_items : Map.room -> Item.item list;Items in the room
characters : Character.character list;characterss in play
active_character : Character.character option;Currently-playing character
character_rooms : Character.character -> int;Location of characters in play - index into map.rooms
xeno_room : int;Location of xenomorph - index into map.rooms
ash_room : int option;Location of Ash, if in play - index into map.rooms
ash_health : int;Ash's health for final mission "You Have My Sympathies"
*)ash_killed : bool;jonesy_caught : bool;Whether Jonesy has been caught
*)round_count : int;How many rounds have passed
*)turn_idx : int;How many turns have passed on this round
*)self_destruct_count : int option;How many turns until self destruct
*)self_destruct_character : Character.character option;On which character's turn does self-destruct counter decrease?
*)character_scraps : Character.character -> int;Scrap per character
character_items : Character.character -> Item.item list;Items per character
encounters : Encounter.encounter list;Un-drawn encounters
discarded_encounters : Encounter.encounter list;Discarded encounters
morale : int;Team morale
*)objectives : Objective.objective list;objectives to complete before the final mission is revealed
cleared_objectives : Objective.objective list;objectives that have been cleared
final_mission : Objective.final_mission option;What the game's final objective is
}Running game state
val game_state : state Stdlib.refReference to the global game state
val locate_character : Character.character -> Map.roomGet room a character is in
val add_character : Character.character -> Map.room -> unitAdd a character to a room
val set_character_room : Character.character -> Map.room -> unitSet the position of a character
val get_character_scrap : Character.character -> intDetermine the number of scrap a character has
val set_character_scrap : Character.character -> int -> unitSet the number of scrap a character has
val get_character_items : Character.character -> Item.item listGet the items in a character's inventory
val add_character_item : Character.character -> Item.item -> unitAdd an item to a character's inventory
val remove_character_item : Character.character -> Item.item -> unitRemove an item from a character's inventory
val pop_character_item : Character.character -> int -> Item.item optionRemove an item from a character and return it
val character_has_item : Item.item -> Character.character -> boolWhether a character has a specific item in their inventory
val character_locations : unit -> (Character.character * Map.room) listList of characters and their locations
val set_room_scrap : Map.room -> int -> unitSet the number of scrap in a room
val set_room_has_event : Map.room -> bool -> unitSet whether a room has an event
val has_coolant : Map.room -> boolCheck whether a room contains coolant
Remove an item from a room and return it, if one exists
val discard_encounter : unit -> Encounter.encounter optionRemove the top encounter from the list of random encounters
Take the top encounter from the discarded encounters list and replace it in the list of random encounters
val get_xeno_room : unit -> Map.roomval set_xeno_room : Map.room -> unitval set_ash_room : Map.room -> unitval add_objective : Objective.objective -> unitval clear_objective : Objective.objective -> unitval start_self_destruct : int -> Character.character -> unitval set_final_mission : Objective.final_mission -> unitval set_turn : int -> Character.character -> unit