equal
deleted
inserted
replaced
20 #include "autoreplace_func.h" |
20 #include "autoreplace_func.h" |
21 #include "string_func.h" |
21 #include "string_func.h" |
22 #include "player_func.h" |
22 #include "player_func.h" |
23 #include "order_func.h" |
23 #include "order_func.h" |
24 #include "oldpool_func.h" |
24 #include "oldpool_func.h" |
|
25 #include "core/alloc_func.hpp" |
25 |
26 |
26 #include "table/strings.h" |
27 #include "table/strings.h" |
27 |
28 |
28 /** |
29 /** |
29 * Update the num engines of a groupID. Decrease the old one and increase the new one |
30 * Update the num engines of a groupID. Decrease the old one and increase the new one |
48 |
49 |
49 |
50 |
50 Group::Group(PlayerID owner) |
51 Group::Group(PlayerID owner) |
51 { |
52 { |
52 this->owner = owner; |
53 this->owner = owner; |
|
54 this->num_engines = CallocT<uint16>(GetEnginePoolSize()); |
53 } |
55 } |
54 |
56 |
55 Group::~Group() |
57 Group::~Group() |
56 { |
58 { |
57 free(this->name); |
59 free(this->name); |
58 this->owner = INVALID_PLAYER; |
60 this->owner = INVALID_PLAYER; |
|
61 free(this->num_engines); |
59 } |
62 } |
60 |
63 |
61 bool Group::IsValid() const |
64 bool Group::IsValid() const |
62 { |
65 { |
63 return this->owner != INVALID_PLAYER; |
66 return this->owner != INVALID_PLAYER; |