Debian Codegraph @

engine/tolua/player.pkg

raw
1 $#include "player.h"
2
3 enum PlayerTypes {
4 PlayerNeutral = 2,
5 PlayerNobody = 3,
6 PlayerComputer = 4,
7 PlayerPerson = 5,
8 PlayerRescuePassive = 6,
9 PlayerRescueActive = 7,
10 };
11
12 class CPlayer
13 {
14 int Index;
15 string Name;
16
17 PlayerTypes Type;
18 string AiName;
19
20 int StartX;
21 int StartY;
22 void SetStartView(int x, int y);
23
24 tolua_property__s int EnergyProductionRate;
25 tolua_property__s int MagmaProductionRate;
26 tolua_property__s int EnergyStored;
27 tolua_property__s int MagmaStored;
28 tolua_property__s int EnergyStorageCapacity;
29 tolua_property__s int MagmaStorageCapacity;
30
31 const int UnitTypesCount[UnitTypeMax];
32
33 int AiEnabled;
34
35 CUnit *Units[UnitMax];
36 int TotalNumUnits;
37 int NumBuildings;
38
39 int UnitLimit;
40 int BuildingLimit;
41 int TotalUnitLimit;
42
43 int Score;
44 int TotalUnits;
45 int TotalBuildings;
46 tolua_property__s int TotalEnergy;
47 tolua_property__s int TotalMagma;
48 int TotalRazings;
49 int TotalKills;
50
51 bool IsEnemy(const CPlayer *x) const;
52 bool IsEnemy(const CUnit *x) const;
53 bool IsAllied(const CPlayer *x) const;
54 bool IsAllied(const CUnit *x) const;
55 bool IsSharedVision(const CPlayer *x) const;
56 bool IsSharedVision(const CUnit *x) const;
57 bool IsBothSharedVision(const CPlayer *x) const;
58 bool IsBothSharedVision(const CUnit *x) const;
59 bool IsTeamed(const CPlayer *x) const;
60 bool IsTeamed(const CUnit *x) const;
61 };
62
63 extern CPlayer Players[PlayerMax];
64 extern CPlayer *ThisPlayer;
65
66 // tolua++ 1.0.93 claims to define TOLUA_NIL, but doesn't,
67 // so we use 0 instead.
68 //
69 // tolua++ 1.0.93 generates code that copies the contents
70 // of the arrays from the wrong Lua stack indexes if the
71 // lua_State * parameter is the first one, so put it last.
72 void CclChangeUnitsOwner @ ChangeUnitsOwner(
73 int topLeft[2],
74 int bottomRight[2],
75 int oldPlayer,
76 int newPlayer,
77 lua_Object unitType = 0 /* TOLUA_NIL */,
78 lua_State *l);