Removed package body for Faction, Deity, Might and Magic...

This commit is contained in:
Ognjen Milan Robovic 2024-06-02 13:00:54 -04:00
parent 92c283f1ca
commit 4ce98c15bf
8 changed files with 20 additions and 144 deletions

View File

@ -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;

View File

@ -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;
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

View File

@ -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;

View File

@ -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;
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

View File

@ -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;

View File

@ -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;
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

View File

@ -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...");
--

View File

@ -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;