-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcharacter.pas
105 lines (73 loc) · 1.78 KB
/
character.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
unit Character;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, CustomTypes, Entities, Voxel, Goods, Schedule;
type
eGoalKind = (gDrink, gEat, gSleep, gBuy, gSell, gOwn, gEarn, gWork, gGetToPos);
rGoal = record
Kind: eGoalKind;
Priority: longword;
end;
eCharProf = (Beggar, Oddjob, Farmer, Lumberjack, Miner,
Blacksmith, WoodCrafter, Trader, Mercenary);
{ tSkillSet }
tSkillSet = class
Skills: array [0..integer(high(eCharProf))] of word;
procedure Rust;
end;
{ tCondition }
tCondition = class
Blood, Energy: quantative;
procedure Consume(Food: quantative); //make universal for dif types
end;
tBaseCharacter = class(tMovableEntity)
Profession: eCharProf;
Wealth: monetary;
end;
{ tCharacter }
tCharacter = class(tMovableEntity)
//Profession: eCharProf; managed by skills?
SkillSet: tSkillSet;
Condition: tCondition;
MajorGoals, MinorGoals: array of rGoal; //long-term/short-term
Assets: array of rAsset;
Home: tStructure;
private
//HomeHub: tEconomicHub;
procedure ManageGoals;
end;
tCharContainer = class
Characters: array of tCharacter;
Schedule: tSchedule;
end;
{ tCharIDContainer }
tCharIDContainer = class
IDs: array of tEntityID;
function LoadExplicit: tCharContainer; //uses major goals to figure out wha happened
end;
implementation
const
EnergyThreshold = 10000;
{ tCondition }
procedure tCondition.Consume(Food: quantative);
begin
Energy+= Food;
end;
{ tCharIDContainer }
function tCharIDContainer.LoadExplicit: tCharContainer;
begin
Result:= nil;
end;
{ tSkillSet }
procedure tSkillSet.Rust;
begin
end;
{ tCharacter }
procedure tCharacter.ManageGoals;
begin
if Condition.Energy < EnergyThreshold then
begin
end;
end;
end.