Changeset View
Changeset View
Standalone View
Standalone View
source/simulation2/components/ICmpRangeManager.h
/* Copyright (C) 2017 Wildfire Games. | /* Copyright (C) 2019 Wildfire Games. | ||||
Silier: 2019 | |||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
▲ Show 20 Lines • Show All 404 Lines • ▼ Show 20 Lines | #endif | ||||
virtual u8 GetPercentMapExplored(player_id_t player) const = 0; | virtual u8 GetPercentMapExplored(player_id_t player) const = 0; | ||||
/** | /** | ||||
* Get percent map explored statistics for specified set of players. | * Get percent map explored statistics for specified set of players. | ||||
* Note: this function computes statistics from scratch and should not be called too often. | * Note: this function computes statistics from scratch and should not be called too often. | ||||
*/ | */ | ||||
virtual u8 GetUnionPercentMapExplored(const std::vector<player_id_t>& players) const = 0; | virtual u8 GetUnionPercentMapExplored(const std::vector<player_id_t>& players) const = 0; | ||||
/** | |||||
* Get whether a position can be explored by specified player. | |||||
Done Inline Actionsactually this should be is position explored as you are passing position in the world and this converts it to tile system Silier: actually this should be is position explored as you are passing position in the world and this… | |||||
*/ | |||||
virtual bool CanPlayerExplorePosition(entity_pos_t x, entity_pos_t y, player_id_t player) const = 0; | |||||
Done Inline Actionsconst = 0; Silier: const = 0; | |||||
Done Inline ActionsGives: CCmpRangeManager.cpp In file included from ../../../source/simulation2/components/CCmpRangeManager.cpp:20:0: ../../../source/simulation2/components/CCmpRangeManager.cpp: In static member function ‘static IComponent* CCmpRangeManager::Allocate(const ScriptInterface&, JS::HandleValue)’: ../../../source/simulation2/system/Component.h:45:96: error: invalid new-expression of abstract class type ‘CCmpRangeManager’ static IComponent* Allocate(const ScriptInterface&, JS::HandleValue) { return new CCmp##cname(); } \ hence I removed the const. Freagarach: Gives:
```
CCmpRangeManager.cpp
In file included from ../../.. | |||||
Done Inline Actionsdid you had this in CCmpRangeManager.cpp ? virtual bool IsTileExplored(CFixedVector2D pos, player_id_t player) const Silier: did you had this in CCmpRangeManager.cpp ?
```
virtual bool IsTileExplored(CFixedVector2D pos… | |||||
Done Inline ActionsNo I hadn't, but it now gives: ICmpRangeManager.cpp In file included from ../../../source/simulation2/components/ICmpRangeManager.cpp:22:0: ../../../source/simulation2/system/InterfaceScripted.h:31:2: error: no matches converting function ‘callMethodConst’ to type ‘JSNative {aka bool (*)(struct JSContext*, unsigned int, class JS::Value*)}’ }; \ ^ Freagarach: No I hadn't, but it now gives:
```
ICmpRangeManager.cpp
In file included from ../../.. | |||||
/** | /** | ||||
* Perform some internal consistency checks for testing/debugging. | * Perform some internal consistency checks for testing/debugging. | ||||
*/ | */ | ||||
virtual void Verify() = 0; | virtual void Verify() = 0; | ||||
DECLARE_INTERFACE_TYPE(RangeManager) | DECLARE_INTERFACE_TYPE(RangeManager) | ||||
}; | }; | ||||
#endif // INCLUDED_ICMPRANGEMANAGER | #endif // INCLUDED_ICMPRANGEMANAGER |
Wildfire Games · Phabricator
2019