From 4ce98c15bf47ef4c1bf50c508bdb1e4f72339268 Mon Sep 17 00:00:00 2001 From: xolatile Date: Sun, 2 Jun 2024 13:00:54 -0400 Subject: [PATCH] Removed package body for Faction, Deity, Might and Magic... --- source/deity.adb | 33 ------------------------------ source/deity.ads | 6 +----- source/faction.adb | 22 -------------------- source/faction.ads | 4 +--- source/magic.adb | 59 ------------------------------------------------------ source/magic.ads | 9 +++------ source/main.adb | 18 ++++++++++++++--- source/might.adb | 13 ------------ 8 files changed, 20 insertions(+), 144 deletions(-) delete mode 100644 source/deity.adb delete mode 100644 source/faction.adb delete mode 100644 source/magic.adb delete mode 100644 source/might.adb diff --git a/source/deity.adb b/source/deity.adb deleted file mode 100644 index 2a1cde1..0000000 --- a/source/deity.adb +++ /dev/null @@ -1,33 +0,0 @@ --- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic --- --- GNU General Public Licence (version 3 or later) - -with core; - -package body deity is - ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - - sprite : array (enumeration) of core.sprite; - - ------------------------------------------------------------------------------------------ - - procedure configure is - begin - core.echo (core.comment, "Configuring deity components..."); - -- - for index in enumeration loop - sprite (index) := core.import_sprite (core.folder & "/game/deity/" & enumeration'image (index) & ".png", 4, 1); - end loop; - end configure; - - ------------------------------------------------------------------------------------------ - - procedure draw (index : in enumeration; x, y : in integer) is - begin - core.draw (sprite (index), x, y); - end draw; - ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - -end deity; diff --git a/source/deity.ads b/source/deity.ads index fc6f977..a1be6b0 100644 --- a/source/deity.ads +++ b/source/deity.ads @@ -41,11 +41,7 @@ package deity is XORANA => ("Xorana ", 0, faction.neutral, attribute.offense, skill.archery, resource.gold) ); - ------------------------------------------------------------------------------------------ - - procedure configure; - - procedure draw (index : in enumeration; x, y : in integer); + sprite : array (enumeration) of core.sprite; ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ diff --git a/source/faction.adb b/source/faction.adb deleted file mode 100644 index 8d4dcdb..0000000 --- a/source/faction.adb +++ /dev/null @@ -1,22 +0,0 @@ --- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic --- --- GNU General Public Licence (version 3 or later) - -with core, attribute, skill, resource; - -package body faction is - ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - - sprite : array (enumeration) of core.sprite; - - ------------------------------------------------------------------------------------------ - - procedure draw (value : in enumeration; x, y : in integer) is - begin - null; - end draw; - ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - -end faction; diff --git a/source/faction.ads b/source/faction.ads index 212b0ee..7ffa0ff 100644 --- a/source/faction.ads +++ b/source/faction.ads @@ -39,9 +39,7 @@ package faction is neutral => ("Neutral ", attribute.offense, skill.archery, resource.gold) ); - ------------------------------------------------------------------------------------------ - - procedure draw (value : in enumeration; x, y : in integer); + sprite : array (enumeration) of core.sprite; ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ diff --git a/source/magic.adb b/source/magic.adb deleted file mode 100644 index 36aac95..0000000 --- a/source/magic.adb +++ /dev/null @@ -1,59 +0,0 @@ --- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic --- --- GNU General Public Licence (version 3 or later) - -with core, ui, effect; - -package body magic is - ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - - view_width : constant natural := 64; - view_height : constant natural := 64; - - view : array (enumeration) of core.sprite; - - ------------------------------------------------------------------------------------------ - - procedure configure is - begin - core.echo (core.comment, "Configuring magic components..."); - -- - for index in enumeration loop - declare folder : constant string := core.lowercase (school'image (description (index).kind)); - file : constant string := core.lowercase (enumeration'image (index)); - begin - view (index) := core.import_sprite (core.folder & "/view/magic/" & folder & "/" & file & ".png", 1, 1); - end; - end loop; - end configure; - - ------------------------------------------------------------------------------------------ - - procedure draw (index : in enumeration; x, y : in integer) is - begin - ui.draw_sprite (view (index), description (index).text, x, y, 0); - end draw; - - ------------------------------------------------------------------------------------------ - - procedure menu (x, y : in integer; center : in boolean) is - offset : constant integer := core.icon; - width : constant integer := count * view_width + (count + 1) * offset + offset / 2; - height : constant integer := view_height + 2 * offset + offset / 2; - move_x : constant integer := (if center then (core.window_width - width) / 2 else x); - move_y : constant integer := (if center then (core.window_height - height) / 2 else y); - begin - ui.draw_tiny_menu (x => move_x, - y => move_y, - width => width, - height => height); - -- - for index in enumeration loop - draw (index, move_x + offset + enumeration'pos (index) * (offset + view_width), move_y + offset); - end loop; - end menu; - ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - -end magic; diff --git a/source/magic.ads b/source/magic.ads index 064e04e..9ea5f31 100644 --- a/source/magic.ads +++ b/source/magic.ads @@ -52,13 +52,10 @@ package magic is ice_armour => ("Ice Armour ", water, 1, effect.none, "Ice Armour increases defense and stamina of selected unit. ") ); - ------------------------------------------------------------------------------------------ + view_width : constant natural := 64; + view_height : constant natural := 64; - procedure configure; - - procedure draw (index : in enumeration; x, y : in integer); - - procedure menu (x, y : in integer; center : in boolean); + view : array (enumeration) of core.sprite; ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ diff --git a/source/main.adb b/source/main.adb index c7dc8b5..e1960f5 100644 --- a/source/main.adb +++ b/source/main.adb @@ -214,8 +214,15 @@ begin resource.icon (index) := core.import_sprite (core.folder & "/icon/resource/" & core.lowercase (resource.enumeration'image (index)) & ".png", 1, 1); end loop; - --~might.configure; - magic.configure; + core.echo (core.comment, "Configuring" & magic.count'image & " magic components..."); + -- + for index in magic.enumeration loop + declare folder : constant string := core.lowercase (magic.school'image (magic.description (index).kind)); + file : constant string := core.lowercase (magic.enumeration'image (index)); + begin + magic.view (index) := core.import_sprite (core.folder & "/view/magic/" & folder & "/" & file & ".png", 1, 1); + end; + end loop; core.echo (core.comment, "Configuring" & material.count'image & " material components..."); -- @@ -235,7 +242,12 @@ begin end loop; unit.configure; - deity.configure; + + core.echo (core.comment, "Configuring" & deity.count'image & " deity components..."); + -- + for index in deity.enumeration loop + deity.sprite (index) := core.import_sprite (core.folder & "/game/deity/" & deity.enumeration'image (index) & ".png", 4, 1); + end loop; core.echo (core.comment, "Configuring" & construction.count'image & "construction components..."); -- diff --git a/source/might.adb b/source/might.adb deleted file mode 100644 index 786c2bc..0000000 --- a/source/might.adb +++ /dev/null @@ -1,13 +0,0 @@ --- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic --- --- GNU General Public Licence (version 3 or later) - -with core, ui, effect; - -package body might is - ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - -end might;