Added all sorts of point saving...

This commit is contained in:
Ognjen Milan Robovic 2024-05-25 03:19:58 -04:00
parent f4453d06a3
commit 68cf53a11f
11 changed files with 67 additions and 1 deletions

View File

@ -53,6 +53,15 @@ package body attribute is
end loop;
end draw_points;
------------------------------------------------------------------------------------------
procedure save_points (here : in core.io.file_type; data : in points) is
begin
for index in enumeration loop
core.save_point (here, data (index));
end loop;
end save_points;
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
end attribute;

View File

@ -46,6 +46,8 @@ package attribute is
x : in integer := 0;
y : in integer := 0);
procedure save_points (here : in core.io.file_type; data : in points);
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
end attribute;

View File

@ -127,6 +127,27 @@ package body chad is
core.draw (alice_the_mad, (core.window_width - core.base) / 2, (core.window_height - core.base) / 2);
end draw_alice;
------------------------------------------------------------------------------------------
procedure save_value (here : in core.io.file_type; data : in value) is
begin
core.io.write (here, enumeration'pos (data.index));
core.io.write (here, core.animation'pos (data.state));
core.io.write (here, data.x);
core.io.write (here, data.y);
--
core.save_point (here, data.health);
core.save_point (here, data.mana);
core.save_point (here, data.stamina);
--
attribute.save_points (here, data.attributes);
skill.save_points (here, data.skills);
resource.save_points (here, data.resources);
--~equipments : equipment.equip_array;
--~item_count : natural;
--~items : item_array;
end save_value;
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
end chad;

View File

@ -70,7 +70,7 @@ package chad is
procedure draw_pepe;
procedure draw_alice;
--~procedure save_value_data (file : in ; data : in value);
procedure save_value (here : in core.io.file_type; data : in value);
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

View File

@ -395,6 +395,14 @@ package body core is
------------------------------------------------------------------------------------------
procedure save_point (here : in io.file_type; data : in point) is
begin
core.io.write (here, data.value);
core.io.write (here, data.limit);
end save_point;
------------------------------------------------------------------------------------------
procedure increment (value : in out integer) is begin value := value + 1; end increment;
procedure decrement (value : in out integer) is begin value := value - 1; end decrement;

View File

@ -183,6 +183,8 @@ package core is
procedure write_help_box (text : in string);
procedure write_text_box (text : in string);
procedure save_point (here : in core.io.file_type; data : in point);
procedure increment (value : in out integer);
procedure decrement (value : in out integer);

View File

@ -51,6 +51,15 @@ package body resource is
end loop;
end draw_points;
------------------------------------------------------------------------------------------
procedure save_points (here : in core.io.file_type; data : in points) is
begin
for index in enumeration loop
core.save_point (here, data (index));
end loop;
end save_points;
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
end resource;

View File

@ -42,6 +42,8 @@ package resource is
procedure draw_points (data : in points; x, y : in integer);
procedure save_points (here : in core.io.file_type; data : in points);
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
end resource;

View File

@ -63,6 +63,15 @@ package body skill is
end loop;
end draw_points;
------------------------------------------------------------------------------------------
procedure save_points (here : in core.io.file_type; data : in points) is
begin
for index in enumeration loop
core.save_point (here, data (index));
end loop;
end save_points;
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
end skill;

View File

@ -60,6 +60,8 @@ package skill is
x : in integer := 0;
y : in integer := 0);
procedure save_points (here : in core.io.file_type; data : in points);
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
end skill;

View File

@ -204,6 +204,8 @@ package body world is
for index in 1 .. equipment_limit loop save_entity (file, map.equipments (index)); end loop;
for index in 1 .. unit_limit loop save_entity (file, map.units (index)); end loop;
--
chad.save_value (file, map.chads (1));
--
core.io.close (file);
--
core.echo (core.success, "Saved current map as '" & file_name & "'.");