LCOV - code coverage report
Current view: top level - source/simulation2/components - ICmpRangeManager.cpp (source / functions) Hit Total Coverage
Test: 0 A.D. test coverage report Lines: 2 12 16.7 %
Date: 2023-01-19 00:18:29 Functions: 4 8 50.0 %

          Line data    Source code
       1             : /* Copyright (C) 2022 Wildfire Games.
       2             :  * This file is part of 0 A.D.
       3             :  *
       4             :  * 0 A.D. is free software: you can redistribute it and/or modify
       5             :  * it under the terms of the GNU General Public License as published by
       6             :  * the Free Software Foundation, either version 2 of the License, or
       7             :  * (at your option) any later version.
       8             :  *
       9             :  * 0 A.D. is distributed in the hope that it will be useful,
      10             :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      11             :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      12             :  * GNU General Public License for more details.
      13             :  *
      14             :  * You should have received a copy of the GNU General Public License
      15             :  * along with 0 A.D.  If not, see <http://www.gnu.org/licenses/>.
      16             :  */
      17             : 
      18             : #include "precompiled.h"
      19             : 
      20             : #include "ICmpRangeManager.h"
      21             : 
      22             : #include "simulation2/system/InterfaceScripted.h"
      23             : 
      24             : namespace {
      25           0 :     std::string VisibilityToString(LosVisibility visibility)
      26             :     {
      27           0 :         switch (visibility)
      28             :         {
      29           0 :         case LosVisibility::HIDDEN: return "hidden";
      30           0 :         case LosVisibility::FOGGED: return "fogged";
      31           0 :         case LosVisibility::VISIBLE: return "visible";
      32           0 :         default: return "error"; // should never happen
      33             :         }
      34             :     }
      35             : }
      36             : 
      37           0 : std::string ICmpRangeManager::GetLosVisibility_wrapper(entity_id_t ent, int player) const
      38             : {
      39           0 :     return VisibilityToString(GetLosVisibility(ent, player));
      40             : }
      41             : 
      42           0 : std::string ICmpRangeManager::GetLosVisibilityPosition_wrapper(entity_pos_t x, entity_pos_t z, int player) const
      43             : {
      44           0 :     return VisibilityToString(GetLosVisibilityPosition(x, z, player));
      45             : }
      46             : 
      47           1 : BEGIN_INTERFACE_WRAPPER(RangeManager)
      48             : DEFINE_INTERFACE_METHOD("ExecuteQuery", ICmpRangeManager, ExecuteQuery)
      49             : DEFINE_INTERFACE_METHOD("ExecuteQueryAroundPos", ICmpRangeManager, ExecuteQueryAroundPos)
      50             : DEFINE_INTERFACE_METHOD("CreateActiveQuery", ICmpRangeManager, CreateActiveQuery)
      51             : DEFINE_INTERFACE_METHOD("CreateActiveParabolicQuery", ICmpRangeManager, CreateActiveParabolicQuery)
      52             : DEFINE_INTERFACE_METHOD("DestroyActiveQuery", ICmpRangeManager, DestroyActiveQuery)
      53             : DEFINE_INTERFACE_METHOD("EnableActiveQuery", ICmpRangeManager, EnableActiveQuery)
      54             : DEFINE_INTERFACE_METHOD("DisableActiveQuery", ICmpRangeManager, DisableActiveQuery)
      55             : DEFINE_INTERFACE_METHOD("IsActiveQueryEnabled", ICmpRangeManager, IsActiveQueryEnabled)
      56             : DEFINE_INTERFACE_METHOD("ResetActiveQuery", ICmpRangeManager, ResetActiveQuery)
      57             : DEFINE_INTERFACE_METHOD("SetEntityFlag", ICmpRangeManager, SetEntityFlag)
      58             : DEFINE_INTERFACE_METHOD("GetEntityFlagMask", ICmpRangeManager, GetEntityFlagMask)
      59             : DEFINE_INTERFACE_METHOD("GetEntitiesByPlayer", ICmpRangeManager, GetEntitiesByPlayer)
      60             : DEFINE_INTERFACE_METHOD("GetNonGaiaEntities", ICmpRangeManager, GetNonGaiaEntities)
      61             : DEFINE_INTERFACE_METHOD("GetGaiaAndNonGaiaEntities", ICmpRangeManager, GetGaiaAndNonGaiaEntities)
      62             : DEFINE_INTERFACE_METHOD("SetDebugOverlay", ICmpRangeManager, SetDebugOverlay)
      63             : DEFINE_INTERFACE_METHOD("ExploreMap", ICmpRangeManager, ExploreMap)
      64             : DEFINE_INTERFACE_METHOD("ExploreTerritories", ICmpRangeManager, ExploreTerritories)
      65             : DEFINE_INTERFACE_METHOD("SetLosRevealAll", ICmpRangeManager, SetLosRevealAll)
      66             : DEFINE_INTERFACE_METHOD("GetLosRevealAll", ICmpRangeManager, GetLosRevealAll)
      67             : DEFINE_INTERFACE_METHOD("GetEffectiveParabolicRange", ICmpRangeManager, GetEffectiveParabolicRange)
      68             : DEFINE_INTERFACE_METHOD("GetElevationAdaptedRange", ICmpRangeManager, GetElevationAdaptedRange)
      69             : DEFINE_INTERFACE_METHOD("ActivateScriptedVisibility", ICmpRangeManager, ActivateScriptedVisibility)
      70             : DEFINE_INTERFACE_METHOD("GetLosVisibility", ICmpRangeManager, GetLosVisibility_wrapper)
      71             : DEFINE_INTERFACE_METHOD("GetLosVisibilityPosition", ICmpRangeManager, GetLosVisibilityPosition_wrapper)
      72             : DEFINE_INTERFACE_METHOD("RequestVisibilityUpdate", ICmpRangeManager, RequestVisibilityUpdate)
      73             : DEFINE_INTERFACE_METHOD("SetLosCircular", ICmpRangeManager, SetLosCircular)
      74             : DEFINE_INTERFACE_METHOD("GetLosCircular", ICmpRangeManager, GetLosCircular)
      75             : DEFINE_INTERFACE_METHOD("SetSharedLos", ICmpRangeManager, SetSharedLos)
      76             : DEFINE_INTERFACE_METHOD("GetPercentMapExplored", ICmpRangeManager, GetPercentMapExplored)
      77             : DEFINE_INTERFACE_METHOD("GetUnionPercentMapExplored", ICmpRangeManager, GetUnionPercentMapExplored)
      78         236 : END_INTERFACE_WRAPPER(RangeManager)

Generated by: LCOV version 1.13