with ada.text_io, ada.strings.unbounded, interfaces.c; use ada.text_io, ada.strings.unbounded, interfaces.c; package core is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ type terminal_colour is ( grey, red, green, yellow, blue, pink, cyan, white ); type terminal_effect is ( normal, bold, italic, underline, blink, invert ); type echo_status is ( failure, warning, success, comment, import, export, deport, ray_ada ); type signal_code is ( signal_none, signal_space, signal_0, signal_1, signal_2, signal_3, signal_4, signal_5, signal_6, signal_7, signal_8, signal_9, signal_a, signal_b, signal_c, signal_d, signal_e, signal_f, signal_g, signal_h, signal_i, signal_j, signal_k, signal_l, signal_m, signal_n, signal_o, signal_p, signal_q, signal_r, signal_s, signal_t, signal_u, signal_v, signal_w, signal_x, signal_y, signal_z, signal_grave, signal_escape, signal_enter, signal_tab, signal_backspace, signal_right, signal_left, signal_down, signal_up, signal_kp_0, signal_kp_1, signal_kp_2, signal_kp_3, signal_kp_4, signal_kp_5, signal_kp_6, signal_kp_7, signal_kp_8, signal_kp_9, signal_kp_subtract, signal_kp_add, signal_left_shift, signal_left_control ); subtype short_string is string (1 .. 24); subtype long_string is string (1 .. 72); type procedure_pointer is access procedure; type colour_range is range 0 .. 2 ** 32 - 1; type sprite is record index, width, height, frames, states : integer; end record; type glyphs is record index, size, pad : integer; end record; type vector is record x, y : integer; end record; type volatile is record data : unbounded_string := null_unbounded_string; rows : integer := 0; columns : integer := 0; end record; ------------------------------------------------------------------------------------------ icon : constant natural := 32; base : constant natural := 32; gameplay_framerate : constant natural := 60; animation_framerate : constant natural := 6; echo_mark : constant array (echo_status) of boolean := ( failure => true, warning => true, success => true, comment => true, import => true, export => true, deport => true, ray_ada => true ); cursor : vector := (0, 0); cursor_mode : integer := 0; signal_mode : integer := 0; engine_active : boolean := false; framerate : integer := 0; global_time : natural := 0; gameplay_time : natural := 0; animation_time : natural := 0; hexagon_grid_sprite : sprite; hexagon_fill_sprite : sprite; camera : vector := (0, 0); text_box : volatile; ------------------------------------------------------------------------------------------ procedure terminal (colour : in terminal_colour := white; effect : in terminal_effect := normal); procedure echo (status : in echo_status; message : in string); procedure dash; procedure semi_dash; function flip_coin return integer; function roll_dice return integer; function by_chance (chance : in integer) return integer; function c_string (ada_string : in string) return string; function random_integer (minimum, maximum : in integer) return integer; function clip (value, minimum, maximum : in integer) return integer; function import_sprite (file_path : in string; frames, states : in integer) return sprite; function import_song (file_path : in string) return integer; function import_glyphs (file_path : in string; size, pad : in integer) return glyphs; procedure crop (data : in sprite; x, y, u, v, width, height : in integer); procedure view (data : in sprite; x, y, u, v, width, height : in integer); procedure draw (data : in sprite; x, y : in integer); procedure move (data : in sprite; x, y, frame, state : in integer); procedure line (origin, offset : in vector); procedure write (text : in string; x, y : in integer; data : in glyphs; colour : in colour_range := 16#FFFFFFFF#); procedure debug (text : in string); procedure hexagonal_grid (x, y, width, height : in integer; fill : in boolean); function lowercase (text : in string) return string; function uppercase (text : in string) return string; procedure draw_central_grid (x, y, width, height : in integer); procedure draw_squared_grid (x, y, width, height : in integer); procedure draw_hexagon_grid (x, y, width, height : in integer); function read_text_box return string; procedure write_text_box (text : in string); procedure initialize; procedure deinitialize; procedure synchronize; function window_width return integer; function window_height return integer; procedure render_sprite (sprite, x, y, u, v, width, height : in integer); procedure render_string (text : in string; x, y : in integer; colour : in colour_range; index, size, pad : in integer); procedure render_vector (x1, y1, x2, y2 : in integer); procedure play_song (index : in integer); procedure stop_song (index : in integer); procedure overlay; ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ end core;