openmohaa/code/fgame/g_spawn.h

80 lines
2.3 KiB
C
Raw Normal View History

2016-03-27 11:49:47 +02:00
/*
===========================================================================
Copyright (C) 2008 the OpenMoHAA team
This file is part of OpenMoHAA source code.
OpenMoHAA source code is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
OpenMoHAA source code is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenMoHAA source code; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
// g_spawn.h : spawner for scripts.
2023-04-29 21:56:38 +02:00
#pragma once
2016-03-27 11:49:47 +02:00
2023-04-29 21:56:38 +02:00
#include "class.h"
#include "container.h"
2016-03-27 11:49:47 +02:00
// spawnflags
// these are set with checkboxes on each entity in the map editor
2023-10-01 20:56:51 +02:00
#define SPAWNFLAG_NOT_EASY 0x00000100
#define SPAWNFLAG_NOT_MEDIUM 0x00000200
#define SPAWNFLAG_NOT_HARD 0x00000400
#define SPAWNFLAG_NOT_DEATHMATCH 0x00000800
2023-10-23 15:56:27 +02:00
#define SPAWNFLAG_DETAIL 0x00001000
2023-10-01 20:56:51 +02:00
#define SPAWNFLAG_DEVELOPMENT 0x00002000
#define SPAWNFLAG_NOCONSOLE 0x00008000
#define SPAWNFLAG_NOPC 0x00010000
2016-03-27 11:49:47 +02:00
class Listener;
class SpawnArgs : public Class
{
private:
2023-10-01 20:56:51 +02:00
Container<str> keyList;
Container<str> valueList;
2016-03-27 11:49:47 +02:00
public:
2023-10-01 20:56:51 +02:00
CLASS_PROTOTYPE(SpawnArgs);
2016-03-27 11:49:47 +02:00
2023-10-01 20:56:51 +02:00
SpawnArgs();
SpawnArgs(SpawnArgs& arglist);
2016-03-27 11:49:47 +02:00
2023-10-01 20:56:51 +02:00
void Clear(void);
2016-03-27 11:49:47 +02:00
2023-10-01 20:56:51 +02:00
char *Parse(char *data, bool bAllowUtils = false);
const char *getArg(const char *key, const char *defaultValue = NULL);
void setArg(const char *key, const char *value);
2016-03-27 11:49:47 +02:00
2023-10-01 20:56:51 +02:00
int NumArgs(void);
const char *getKey(int index);
const char *getValue(int index);
void operator=(SpawnArgs &a);
2016-03-27 11:49:47 +02:00
2023-10-01 20:56:51 +02:00
ClassDef *getClassDef(qboolean *tikiWasStatic = NULL);
Listener *Spawn(void);
Listener *SpawnInternal(void);
2016-03-27 11:49:47 +02:00
2023-10-01 20:56:51 +02:00
void Archive(Archiver& arc) override;
2016-03-27 11:49:47 +02:00
};
2023-10-01 20:56:51 +02:00
extern Container<SafePtr<Listener>> g_spawnlist;
2016-03-27 11:49:47 +02:00
2023-10-01 20:56:51 +02:00
ClassDef *FindClass(const char *name, qboolean *isModel);
2016-03-27 11:49:47 +02:00
#ifdef GAME_DLL
2023-10-01 20:56:51 +02:00
void G_InitClientPersistant(gclient_t *client);
2016-03-27 11:49:47 +02:00
#endif