TABLE OF CONTENTS


Bases/Bases [ Packages ]

[ Top ] [ Packages ]

FUNCTION

 Provide code for manipulate sky bases

SOURCE

package Bases is

Bases/Bases.BaseCargo_Container [ Types ]

[ Top ] [ Bases ] [ Types ]

FUNCTION

 Used to store sky bases cargos

SOURCE

   package BaseCargo_Container is new Formal_Indefinite_Vectors
     (Index_Type => Positive, Element_Type => Base_Cargo,
      Max_Size_In_Storage_Elements => Base_Cargo'Size, Bounded => False);

Bases/Bases.Bases_Size [ Types ]

[ Top ] [ Bases ] [ Types ]

FUNCTION

 Bases sizes

SOURCE

   type Bases_Size is (SMALL, MEDIUM, BIG, UNKNOWN) with
      Default_Value => MEDIUM;

Bases/Bases.Recruit_Amount_Range [ Types ]

[ Top ] [ Bases ] [ Types ]

FUNCTION

 Used to set the amount of available recruits in bases

SOURCE

   subtype Recruit_Amount_Range is Positive range 1 .. 60;

HISTORY

 7.5 - Added

Bases/Bases.Recruit_Container [ Types ]

[ Top ] [ Bases ] [ Types ]

FUNCTION

 Used to store sky bases recruits data

SOURCE

   package Recruit_Container is new Formal_Indefinite_Vectors
     (Index_Type => Recruit_Amount_Range, Element_Type => Recruit_Data,
      Max_Size_In_Storage_Elements => Recruit_Data'Size, Bounded => False);

Bases/Bases.Base_Cargo [ Records ]

[ Top ] [ Bases ] [ Records ]

FUNCTION

 Data structure for bases cargo

SOURCE

   type Base_Cargo is record
      Proto_Index: Natural;
      Amount: Natural;
      Durability: Items_Durability;
      Price: Natural;
   end record;

PARAMETERS

 Proto_Index - Index of item prototype
 Amount      - Amount of items
 Durability  - Durability of items
 Price       - Current price of item

Bases/Bases.Base_Record [ Records ]

[ Top ] [ Bases ] [ Records ]

FUNCTION

 Data structure for bases

SOURCE

   type Base_Record is record
      Name: Tiny_String.Bounded_String;
      Visited: Date_Record;
      Sky_X: Map_X_Range;
      Sky_Y: Map_Y_Range;
      Base_Type: Tiny_String.Bounded_String;
      Population: Natural;
      Recruit_Date: Date_Record;
      Recruits: Recruit_Container.Vector (Capacity => 5);
      Known: Boolean;
      Asked_For_Bases: Boolean;
      Asked_For_Events: Date_Record;
      Reputation: Reputation_Data;
      Missions_Date: Date_Record;
      Missions: Mission_Container.Vector;
      Owner: Tiny_String.Bounded_String;
      Cargo: BaseCargo_Container.Vector (Capacity => 32);
      Size: Bases_Size;
   end record;

PARAMETERS

 Name             - Base name
 Visited          - Time when player last visited base
 Sky_X            - X coordinate on sky map
 Sky_Y            - Y coordinate on sky map
 Base_Type        - Type of base
 Population       - Amount of people in base
 Recruit_Date     - Time when recruits was generated
 Recruits         - List of available recruits
 Known            - Did base is know to player
 Asked_For_Bases  - Did player asked for bases in this base
 Asked_For_Events - Time when players asked for events in this base
 Reputation       - Reputation level and progress of player
 Missions_Date    - Time when missions was generated
 Missions         - List of available missions
 Owner            - Index of faction which own base
 Cargo            - List of all cargo in base
 Size             - Size of base

Bases/Bases.Recruit_Data [ Records ]

[ Top ] [ Bases ] [ Records ]

FUNCTION

 Data structure for recruits

SOURCE

   type Recruit_Data is new Mob_Record with record
      Name: Tiny_String.Bounded_String;
      Gender: Character;
      Price: Positive;
      Inventory: Positive_Formal_Container.Vector (Capacity => 7);
      Equipment: Equipment_Array;
      Payment: Positive;
      Home_Base: Bases_Range;
      Faction: Tiny_String.Bounded_String;
   end record;

PARAMETERS

 Name       - Name of recruit
 Gender     - Gender of recruit
 Skills     - Names indexes, levels and experience in skills of recruit
 Cost       - Cost of enlist of recruit
 Attributes - Names indexes, levels and experience in attributes of
              recruit
 Inventory  - Owned items by recruit
 Equipment  - Items indexes from inventory used by recruit.
 Payment    - How much money recruit will take as payment each day.
 Home_Base  - Index of base from which recruit is
 Faction    - Index of faction to which recruit belongs

Bases/Bases.Default_Base_Size [ Constants ]

[ Top ] [ Bases ] [ Constants ]

FUNCTION

 The default size of a base

SOURCE

   Default_Base_Size: constant Bases_Size := MEDIUM;

Bases/Bases.Empty_Base_Cargo [ Constants ]

[ Top ] [ Bases ] [ Constants ]

FUNCTION

 Empty base cargo

SOURCE

   Empty_Base_Cargo: constant Base_Cargo :=
     (Proto_Index => 0, Amount => 0, Durability => Default_Item_Durability,
      Price => 0);

Bases/Bases.SkyBases [ Variables ]

[ Top ] [ Bases ] [ Variables ]

FUNCTION

 List of sky bases

SOURCE

   Sky_Bases: array(Bases_Range) of Base_Record;

Bases/Bases.Count_Price [ Subprograms ]

[ Top ] [ Bases ] [ Subprograms ]

FUNCTION

 Count price for actions with bases (buying/selling/docking/ect)

SOURCE

   procedure Count_Price
     (Price: in out Natural; Trader_Index: Crew_Container.Extended_Index;
      Reduce: Boolean := True) with
      Pre => Trader_Index <= Player_Ship.Crew.Last_Index;

PARAMETERS

 Price        - Cost of action with the base
 Trader_Index - Index of crew member assigned as trader or 0 if noone is
                assigned
 Reduce       - If true, reduce cost of action, otherwise raise. Default
                is true

RESULT

 Parameter Cost

Bases/Bases.Generate_Base_Name [ Subprograms ]

[ Top ] [ Bases ] [ Subprograms ]

FUNCTION

 Generate random name for base based on faction

SOURCE

   function Generate_Base_Name
     (Faction_Index: Tiny_String.Bounded_String)
      return Tiny_String.Bounded_String with
      Post => Tiny_String.Length(Source => Generate_Base_Name'Result) > 0;

PARAMETERS

 Faction_Index - Index of faction to which base belong

RESULT

 Random name for the sky base