38 lines
1.5 KiB
Ada
38 lines
1.5 KiB
Ada
-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
|
|
--
|
|
-- GNU General Public Licence (version 3 or later)
|
|
|
|
with core, effect, resource, faction, construction;
|
|
|
|
package body construction is
|
|
|
|
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
sprite : array (enumeration) of core.sprite;
|
|
|
|
------------------------------------------------------------------------------------------
|
|
|
|
procedure configure is
|
|
begin
|
|
core.echo (core.comment, "Configuring construction components...");
|
|
--
|
|
for index in enumeration loop
|
|
declare folder : constant string := core.lowercase (faction.enumeration'image (trait (index).kind));
|
|
file : constant string := core.lowercase (enumeration'image (index));
|
|
begin
|
|
sprite (index) := core.import_sprite ("./sprite/construction/" & folder & "/" & file & ".png", trait (index).frames, 1);
|
|
end;
|
|
end loop;
|
|
end configure;
|
|
|
|
------------------------------------------------------------------------------------------
|
|
|
|
procedure draw (index : in enumeration; x, y : in integer) is
|
|
begin
|
|
core.draw (sprite (index), x, y, trait (index).frames, 1);
|
|
end draw;
|
|
|
|
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
end construction;
|