Resource and skill refactoring...
This commit is contained in:
parent
1e88d09de1
commit
35a568f6ab
@ -17,8 +17,15 @@ package body resource is
|
|||||||
end define;
|
end define;
|
||||||
--
|
--
|
||||||
structure : ui.structure;
|
structure : ui.structure;
|
||||||
|
--
|
||||||
|
time : float := 0.0;
|
||||||
begin
|
begin
|
||||||
core.echo (core.comment, "Configuring resource components...");
|
time := core.time;
|
||||||
|
--
|
||||||
|
core.echo (core.comment, "Configuring" & count'image & " resource components...");
|
||||||
|
--
|
||||||
|
description := new description_array (enumeration'range);
|
||||||
|
icon := new icon_array (enumeration'range);
|
||||||
--
|
--
|
||||||
define (gold, 24, 480, "Gold", "Gold is precious yellowish shiny metal, valued since ancient times.");
|
define (gold, 24, 480, "Gold", "Gold is precious yellowish shiny metal, valued since ancient times.");
|
||||||
define (wood, 12, 240, "Wood", "Wood is just bundle of lignin and cellulose, nothing more.");
|
define (wood, 12, 240, "Wood", "Wood is just bundle of lignin and cellulose, nothing more.");
|
||||||
@ -43,6 +50,8 @@ package body resource is
|
|||||||
--
|
--
|
||||||
ui.add_structure_button (icon (index), description (index).name, description (index).text);
|
ui.add_structure_button (icon (index), description (index).name, description (index).text);
|
||||||
end loop;
|
end loop;
|
||||||
|
--
|
||||||
|
core.echo (core.success, "Successfully configured resource information in" & natural'image (natural (1_000_000.0 * (core.time - time))) & " microseconds.");
|
||||||
end configure;
|
end configure;
|
||||||
|
|
||||||
------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------
|
||||||
|
@ -23,12 +23,15 @@ package resource is
|
|||||||
type points is array (enumeration) of core.point;
|
type points is array (enumeration) of core.point;
|
||||||
type price is array (enumeration) of natural;
|
type price is array (enumeration) of natural;
|
||||||
|
|
||||||
|
type description_array is array (enumeration range <>) of definition;
|
||||||
|
type icon_array is array (enumeration range <>) of core.sprite;
|
||||||
|
|
||||||
------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
count : constant natural := enumeration'pos (enumeration'last) + 1;
|
count : constant natural := enumeration'pos (enumeration'last) + 1;
|
||||||
|
|
||||||
description : array (enumeration) of definition;
|
description : access description_array;
|
||||||
icon : array (enumeration) of core.sprite;
|
icon : access icon_array;
|
||||||
|
|
||||||
------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -17,8 +17,15 @@ package body skill is
|
|||||||
end define;
|
end define;
|
||||||
--
|
--
|
||||||
structure : ui.structure;
|
structure : ui.structure;
|
||||||
|
--
|
||||||
|
time : float := 0.0;
|
||||||
begin
|
begin
|
||||||
core.echo (core.comment, "Configuring skill components...");
|
time := core.time;
|
||||||
|
--
|
||||||
|
core.echo (core.comment, "Configuring" & count'image & " skill components...");
|
||||||
|
--
|
||||||
|
description := new description_array (enumeration'range);
|
||||||
|
icon := new icon_array (enumeration'range);
|
||||||
--
|
--
|
||||||
define (alchemy, 0, 24, "Alchemy", "Alchemy skill determines effectiveness of your vials and potions.");
|
define (alchemy, 0, 24, "Alchemy", "Alchemy skill determines effectiveness of your vials and potions.");
|
||||||
define (archery, 0, 24, "Archery", "Archery skill determines effectiveness and range or your archers.");
|
define (archery, 0, 24, "Archery", "Archery skill determines effectiveness and range or your archers.");
|
||||||
@ -59,6 +66,8 @@ package body skill is
|
|||||||
--
|
--
|
||||||
ui.add_structure_button (icon (index), description (index).name, description (index).text);
|
ui.add_structure_button (icon (index), description (index).name, description (index).text);
|
||||||
end loop;
|
end loop;
|
||||||
|
--
|
||||||
|
core.echo (core.success, "Successfully configured skill information in" & natural'image (natural (1_000_000.0 * (core.time - time))) & " microseconds.");
|
||||||
end configure;
|
end configure;
|
||||||
|
|
||||||
------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------
|
||||||
|
@ -25,14 +25,17 @@ package skill is
|
|||||||
type points is array (enumeration) of core.point;
|
type points is array (enumeration) of core.point;
|
||||||
type bonus is array (enumeration) of natural;
|
type bonus is array (enumeration) of natural;
|
||||||
|
|
||||||
default : points := (others => (0, 24));
|
type description_array is array (enumeration range <>) of definition;
|
||||||
|
type icon_array is array (enumeration range <>) of core.sprite;
|
||||||
|
|
||||||
------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
count : constant natural := enumeration'pos (enumeration'last) + 1;
|
count : constant natural := enumeration'pos (enumeration'last) + 1;
|
||||||
|
|
||||||
description : array (enumeration) of definition;
|
default : constant points := (others => (0, 24));
|
||||||
icon : array (enumeration) of core.sprite;
|
|
||||||
|
description : access description_array;
|
||||||
|
icon : access icon_array;
|
||||||
|
|
||||||
------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user