mirror of
https://github.com/devZoGok/PlanetFleet.git
synced 2026-08-26 19:43:29 +00:00
rovers can transfer different resources
This commit is contained in:
+6
-3
@@ -17,12 +17,15 @@ namespace battleship{
|
||||
private:
|
||||
void initProperties();
|
||||
void supply(Order);
|
||||
void collectRefineds(Order, float);
|
||||
void transferResource(Structure*, float);
|
||||
Unit* getClosestUnit(std::vector<Structure*>);
|
||||
inline bool canLoad(){return vb01::getTime() - lastLoadTime > loadRate && load < capacity;}
|
||||
inline bool canUnload(){return vb01::getTime() - lastLoadTime > loadRate && load > 0;}
|
||||
inline bool canLoad(){return vb01::getTime() - lastLoadTime > loadRate && calcTotalLoad() < capacity;}
|
||||
inline bool canUnload(int id){return vb01::getTime() - lastLoadTime > loadRate && load[id] > 0;}
|
||||
inline int calcTotalLoad(){return load[0] + load[1] + load[2];}
|
||||
|
||||
vb01::s64 lastLoadTime = 0;
|
||||
int load = 0, capacity, loadRate, loadSpeed;
|
||||
int load[3]{0, 0, 0}, capacity, loadRate, loadSpeed;
|
||||
Extractor *nearestExtractor = nullptr;
|
||||
Unit *nearestRefinery = nullptr;
|
||||
vb01::Node *loadBackground = nullptr, *loadForeground = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user