LCOV - code coverage report
Current view: top level - Core/Scripting - OOJSEntity.h (source / functions) Hit Total Coverage
Test: coverxygen.info Lines: 0 10 0.0 %
Date: 2025-05-28 07:50:54 Functions: 0 0 -

          Line data    Source code
       1           0 : /*
       2             : 
       3             : OOJSEntity.h
       4             : 
       5             : JavaScript proxy for entities.
       6             : 
       7             : Oolite
       8             : Copyright (C) 2004-2013 Giles C Williams and contributors
       9             : 
      10             : This program is free software; you can redistribute it and/or
      11             : modify it under the terms of the GNU General Public License
      12             : as published by the Free Software Foundation; either version 2
      13             : of the License, or (at your option) any later version.
      14             : 
      15             : This program is distributed in the hope that it will be useful,
      16             : but WITHOUT ANY WARRANTY; without even the implied warranty of
      17             : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      18             : GNU General Public License for more details.
      19             : 
      20             : You should have received a copy of the GNU General Public License
      21             : along with this program; if not, write to the Free Software
      22             : Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
      23             : MA 02110-1301, USA.
      24             : 
      25             : */
      26             : 
      27             : #import <Foundation/Foundation.h>
      28             : #import "OOJavaScriptEngine.h"
      29             : #import "Universe.h"
      30             : 
      31             : @class Entity;
      32             : 
      33             : 
      34           0 : void InitOOJSEntity(JSContext *context, JSObject *global);
      35             : 
      36           0 : BOOL JSValueToEntity(JSContext *context, jsval value, Entity **outEntity);
      37             : 
      38           0 : extern JSClass gOOEntityJSClass;
      39           0 : extern JSObject *gOOEntityJSPrototype;
      40             : DEFINE_JS_OBJECT_GETTER(OOJSEntityGetEntity, &gOOEntityJSClass, gOOEntityJSPrototype, Entity)
      41             : 
      42           0 : OOINLINE JSClass *JSEntityClass(void)  { return &gOOEntityJSClass; }
      43           0 : OOINLINE JSObject *JSEntityPrototype(void)  { return gOOEntityJSPrototype; }
      44             : 
      45             : 
      46             : /*      EntityFromArgumentList()
      47             :         
      48             :         Construct a entity from an argument list containing a JS Entity object.
      49             :         The optional outConsumed argument can be used to find out how many
      50             :         parameters were used (currently, this will be 0 on failure, otherwise 1).
      51             :         
      52             :         On failure, it will return NO, annd the entity will be unaltered. If
      53             :         scriptClass and function are non-nil, a warning will be reported to the
      54             :         log.
      55             : */
      56           0 : BOOL EntityFromArgumentList(JSContext *context, NSString *scriptClass, NSString *function, uintN argc, jsval *argv, Entity **outEntity, uintN *outConsumed);
      57             : 
      58             : 
      59             : /*
      60             :         For scripting purposes, a JS entity object is a stale reference if its
      61             :         underlying ObjC object is nil, or if it refers to the player and the
      62             :         blockJSPlayerShipProps flag is in effect (i.e., the escape pod sequence is
      63             :         active).
      64             : */
      65           0 : OOINLINE BOOL OOIsPlayerStale(void)
      66             : {
      67             :         extern Entity *gOOJSPlayerIfStale;
      68             :         return gOOJSPlayerIfStale != nil;
      69             : }
      70             : 
      71           0 : OOINLINE BOOL OOIsStaleEntity(Entity *entity)
      72             : {
      73             :         extern Entity *gOOJSPlayerIfStale;
      74             :         return entity == nil || (entity == gOOJSPlayerIfStale);
      75             : }

Generated by: LCOV version 1.14