#include "graph.h" #include "resonance.h" #include #include const GlyphDef GLYPH_DEFS[64] = {0}; GlyphGraph* graph_create(const char* name, uint32_t cap) { GlyphGraph* g = calloc(1, sizeof(GlyphGraph)); g->name = strdup(name ? name : "unnamed"); g->nodes = calloc(cap, sizeof(GlyphNode)); return g; } void graph_destroy(GlyphGraph* g) { if(g) { free(g->name); free(g->nodes); free(g); } } int graph_add_node_with_value(GlyphGraph* g, uint8_t glyph_id, int value) { uint32_t idx = g->node_count++; g->nodes[idx].active = 1; g->nodes[idx].glyph_id = glyph_id; g->nodes[idx].energy = SYM_MODERATE; g->nodes[idx].stability = SYM_STRONG; return idx; } void graph_connect(GlyphGraph* g, uint32_t from, uint32_t to, SymResonance weight) { if(g->nodes[from].edge_count < 8) { g->nodes[from].edges[g->nodes[from].edge_count] = to; g->nodes[from].edge_weights[g->nodes[from].edge_count] = weight; g->nodes[from].edge_count++; } } void graph_compact(GlyphGraph* g) {} void graph_print(GlyphGraph* g) {} const GlyphDef* glyph_lookup(const char* name) { return &GLYPH_DEFS[0]; } const char* sym_level_name(SymLevel l) { return "LEVEL"; } const char* sym_res_name(SymResonance r) { return "RES"; } SymLevel sym_decay(SymLevel s, SymLevel c) { return s; } SymLevel sym_diminish(SymLevel e, int amt) { return e; } SymLevel sym_boost(SymLevel e, int amt) { return e; } int resonance_conflicts(TraitMask a, TraitMask b) { return 0; } SymResonance resonance_between_nodes(GlyphNode* a, GlyphNode* b) { return RES_HARMONIC; } SymResonance resonance_between_glyphs(uint8_t a, uint8_t b) { return RES_HARMONIC; }