Changeset 277 for trunk/UUnit.pas


Ignore:
Timestamp:
Feb 5, 2019, 11:17:27 PM (6 years ago)
Author:
chronos
Message:
  • Added: Forms for list of unit kinds and unit kind.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UUnit.pas

    r265 r277  
    1919    Moves: Integer;
    2020    Cost: Integer;
    21     Stack: Integer;
     21    Power: Integer;
    2222    ViewRange: Integer;
     23    procedure Assign(Source: TUnitKind);
    2324    procedure LoadFromNode(Node: TDOMNode);
    2425    procedure SaveToNode(Node: TDOMNode);
     
    8990{ TUnitKind }
    9091
     92procedure TUnitKind.Assign(Source: TUnitKind);
     93begin
     94  Id := Source.Id;
     95  Name := Source.Name;
     96  PowerAttack := Source.PowerAttack;
     97  PowerDefense := Source.PowerDefense;
     98  Moves := Source.Moves;
     99  Cost := Source.Cost;
     100  Power := Source.Power;
     101  ViewRange := Source.ViewRange;
     102end;
     103
    91104procedure TUnitKind.LoadFromNode(Node: TDOMNode);
    92105begin
    93106  Id := ReadInteger(Node, 'Id', 0);
    94107  Name := ReadString(Node, 'Name', '');
    95   Stack := ReadInteger(Node, 'Stack', 0);
     108  Power := ReadInteger(Node, 'Stack', 0);
    96109  Cost := ReadInteger(Node, 'Cost', 0);
    97110  Moves := ReadInteger(Node, 'Moves', 0);
     
    105118  WriteInteger(Node, 'Id', Id);
    106119  WriteString(Node, 'Name', Name);
    107   WriteInteger(Node, 'Stack', Stack);
     120  WriteInteger(Node, 'Stack', Power);
    108121  WriteInteger(Node, 'Cost', Cost);
    109122  WriteInteger(Node, 'Moves', Moves);
Note: See TracChangeset for help on using the changeset viewer.