TABLE OF CONTENTS
- 1. Bases/BTrade
Bases/BTrade [ Packages ]
[ Top ] [ Bases ] [ Packages ]
FUNCTION
Provide code for hiring recruits, buying recipes, heal and train crew members in bases.
SOURCE
package Bases.Trade is
BTrade/BTrade.Buy_Recipe [ Subprograms ]
[ Top ] [ BTrade ] [ Subprograms ]
FUNCTION
Buy new crafting recipe
SOURCE
procedure Buy_Recipe(Recipe_Index: Tiny_String.Bounded_String) with Pre => Tiny_String.Length(Source => Recipe_Index) > 0;
PARAMETERS
Recipe_Index - Index of the recipe from base recipes list to buy
BTrade/BTrade.Heal_Cost [ Subprograms ]
[ Top ] [ BTrade ] [ Subprograms ]
FUNCTION
Count cost of healing action
SOURCE
procedure Heal_Cost (Cost, Time: in out Natural; Member_Index: Crew_Container.Extended_Index) with Import => True, Convention => C, External_Name => "healAdaCost", Pre => Member_Index <= Player_Ship.Crew.Last_Index, Post => Cost > 0 and Time > 0;
PARAMETERS
Cost - Overall cost of heal wounded player ship crew member(s) Time - Time needed to heal wounded player ship crew member(s) Member_Index - Index of player ship crew member to heal or 0 for heal all wounded crew members
RESULT
Parameters Cost and Time
BTrade/BTrade.Heal_Wounded [ Subprograms ]
[ Top ] [ BTrade ] [ Subprograms ]
FUNCTION
Heals wounded crew members in bases
SOURCE
procedure Heal_Wounded(Member_Index: Crew_Container.Extended_Index) with Pre => Member_Index <= Player_Ship.Crew.Last_Index;
PARAMETERS
Member_Index - Index of player ship crew member to heal or 0 for heal all wounded crew members
BTrade/BTrade.Hire_Recruit [ Subprograms ]
[ Top ] [ BTrade ] [ Subprograms ]
FUNCTION
Hire selected recruit from bases and add him/her to player ship crew
SOURCE
procedure Hire_Recruit (Recruit_Index: Recruit_Container.Extended_Index; Cost: Positive; Daily_Payment, Trade_Payment: Natural; Contract_Length: Integer);
PARAMETERS
Recruit_Index - Index of recruit, from base recruits list to hire Cost - Cost of hire of selected recruit Daily_Payment - Daily payment of selected recruit Trade_Payment - Percent of earnings from each trade which this recruit will take Contract_Length - Length of the contract with this recruit in days. 0 means infinite contract
BTrade/BTrade.Train_Cost [ Subprograms ]
[ Top ] [ BTrade ] [ Subprograms ]
FUNCTION
Count cost of training action
SOURCE
function Train_Cost (Member_Index: Crew_Container.Extended_Index; Skill_Index: Skills_Container.Extended_Index) return Natural with Pre => Member_Index in Player_Ship.Crew.First_Index .. Player_Ship.Crew.Last_Index and Skill_Index in 1 .. Skills_Amount, Import => True, Convention => C, External_Name => "trainAdaCost";
PARAMETERS
Member_Index - Index of player ship crew member which will be training Skill_Index - Index of skill of selected crew member which will be training
RESULT
Overall cost of training selected skill by selected crew member. Return 0 if the skill can't be trained because is maxed.
BTrade/BTrade.Train_Skill [ Subprograms ]
[ Top ] [ BTrade ] [ Subprograms ]
FUNCTION
Train selected skill
SOURCE
procedure Train_Skill (Member_Index: Crew_Container.Extended_Index; Skill_Index: Skills_Container.Extended_Index; Amount: Positive; Is_Amount: Boolean := True) with Pre => Member_Index in Player_Ship.Crew.First_Index .. Player_Ship.Crew.Last_Index and Skill_Index in 1 .. Skills_Amount;
PARAMETERS
Member_Index - Index of Player_Ship crew member which train Skill_Index - Index of skill of selected crew member to train Amount - How many times train or how many money spend on training Is_Amount - If true, Amount variable is how many times train, otherwise it is amount of money to spend