Nimbin[12]?Games / Entropie / entropie/src/world/stage.h

Entropie git · main

Entropie festival game; first steps

sdl c game entropie cmake · first commit 2026-10-10 · last commit 2026-11-02 (18 hours ago) · synced 10 hours ago

C 88.5% Markdown 9.1% GLSL 2.3%
git clone https://git.christianimmanuel.de/games/Entropie.gitwget https://git.christianimmanuel.de/games/Entropie/archive/Entropie.tar.gz
entropie/src/world/stage.h 2.2 KB · 42 lines raw
#ifndef WORLD_STAGE_H
#define WORLD_STAGE_H

/*
 * The floors' stages, built step by step (OBJ_STAGE, one per floor: Hofbuehne,
 * Obstwiese, Kartoffelacker, the hidden floor). Each step takes work (person-
 * hours, quicker for the skilled) and its material lying by it: the frame
 * logs, the deck boards and nails, the roof boards and screws, the decoration
 * paint (bought: game_shop.c), used up when the step is done. The look grows
 * as the work goes on, the deck can be stood on once it's in.
 */

#include "world/world.h"
#include "world/cast.h"

typedef enum { BUILD_MARKED, BUILD_FRAME, BUILD_FLOOR, BUILD_ROOF, BUILD_DECOR, BUILD_DONE } BuildStage;

#define STAGE_LOGS      3      /* logs lying by it for the frame */
#define STAGE_LOG_REACH 6.0f   /* m round its middle: material lying this near counts */

/* A stage marked out (nothing built yet) for a floor project, its front turned to yaw. */
Object     *Stage_create(Project project, Vec3 at, float yaw);
/* The stage of a project in the world, or NULL. */
Object     *Stage_of(Object *const *objects, int count, Project project);
/* What's being done now ("the frame"), said plainly; and how far (0..1). */
const char *Stage_stepName(int stage);
float       Stage_part(const Object *stage);
/* Material still missing for this step (0: none needed, or all there); what: said plainly
   ("2 bundles of boards and a box of nails"), may be NULL. */
int         Stage_missing(const World *world, const Object *stage, char *what, size_t size);
/* The bought material it waits for (MaterialKind), or -1 (nothing, or only logs). */
int         Stage_missingMaterial(const World *world, const Object *stage);
/* Work on it: person_hours of work done (by somebody of that skill). Returns the
   step just finished (BUILD_FRAME ...), -1 nothing new, -2 held up (material missing). */
int         Stage_work(World *world, Object *stage, float person_hours);
/* Where somebody works on it (side -1 .. 1 along the front), and where their hands are. */
Vec3        Stage_workSpot(const Object *stage, float side);
Vec3        Stage_handsAt(const Object *stage, Vec3 spot, float t);
/* Its look after work or loading (only rebuilt when it changes). */
void        Stage_show(Object *stage);

#endif /* WORLD_STAGE_H */