xhads/source/unit.adb

68 lines
2.7 KiB
Ada

-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
--
-- GNU General Public Licence (version 3 or later)
with core, ui, effect, attribute, faction;
package body unit is
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
view_width : constant integer := 48;
view_height : constant integer := 64;
base : array (faction.fairy .. faction.imp) of core.sprite;
--~sprite : array (enumeration) of core.sprite;
--~icon : array (enumeration) of core.sprite;
--~view : array (enumeration) of core.sprite;
------------------------------------------------------------------------------------------
procedure configure is
begin
core.echo (core.comment, "Configuring unit components...");
--
for index in faction.fairy .. faction.imp loop
base (index) := core.import_sprite (core.folder & "/game/unit/" & core.lowercase (faction.enumeration'image (index)) & "/base.png", 4, 6);
end loop;
end configure;
------------------------------------------------------------------------------------------
--~procedure draw (index : in enumeration; state : in core.animation; x, y : in integer) is
--~begin
--~core.draw (sprite (index), x, y, state => state);
--~end draw;
------------------------------------------------------------------------------------------
--~procedure draw_icon (index : in enumeration; x, y : in integer) is
--~begin
--~ui.draw_overicon (icon (index), trait (index).text, x, y);
--~end draw_icon;
------------------------------------------------------------------------------------------
--~procedure draw_view (index : in enumeration; x, y : in integer) is
--~offset : constant integer := 4;
--~begin
--~core.draw (view (index), x + offset, y + offset);
--~ui.draw_icon_menu (x, y, view_width + 2 * offset, view_height + 2 * offset);
--~end draw_view;
------------------------------------------------------------------------------------------
procedure draw_full (index : in enumeration; state : in core.animation; x, y : in integer) is
begin
core.draw (base (trait (index).kind), x, y, state => state);
--
for slot in equipment.slot loop
equipment.draw (trait (index).equipments (slot), state, x, y);
end loop;
end draw_full;
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
end unit;