2019-03-13 20:56:43 +00:00
|
|
|
/***
|
|
|
|
*
|
|
|
|
* Copyright (c) 2016-2019 Marco 'eukara' Hladik. All rights reserved.
|
|
|
|
*
|
|
|
|
* See the file LICENSE attached with the sources for usage details.
|
|
|
|
*
|
|
|
|
****/
|
|
|
|
|
|
|
|
string __fullspawndata;
|
|
|
|
|
2019-03-19 19:01:24 +00:00
|
|
|
class CBaseEntity
|
|
|
|
{
|
2019-03-13 20:56:43 +00:00
|
|
|
string targetname;
|
|
|
|
string target;
|
2019-03-19 19:01:24 +00:00
|
|
|
|
2019-03-13 20:56:43 +00:00
|
|
|
void() CBaseEntity;
|
|
|
|
|
|
|
|
virtual void() Init;
|
2019-03-14 19:13:02 +00:00
|
|
|
virtual void() Initialized;
|
2019-03-13 20:56:43 +00:00
|
|
|
virtual void(string, string) SpawnKey;
|
|
|
|
};
|
|
|
|
|
2019-03-19 19:01:24 +00:00
|
|
|
void CBaseEntity::SpawnKey(string strField, string strKey)
|
|
|
|
{
|
|
|
|
switch (strField) {
|
2019-03-13 20:56:43 +00:00
|
|
|
case "targetname":
|
|
|
|
targetname = strKey;
|
|
|
|
break;
|
|
|
|
case "target":
|
|
|
|
target = strKey;
|
|
|
|
break;
|
|
|
|
case "origin":
|
2019-03-19 19:01:24 +00:00
|
|
|
origin = stov(strKey);
|
|
|
|
setorigin(this, origin);
|
2019-03-13 20:56:43 +00:00
|
|
|
break;
|
|
|
|
case "angles":
|
2019-03-19 19:01:24 +00:00
|
|
|
angles = stov(strKey);
|
2019-03-13 20:56:43 +00:00
|
|
|
break;
|
|
|
|
case "model":
|
|
|
|
model = strKey;
|
|
|
|
break;
|
|
|
|
case "style":
|
2019-03-19 19:01:24 +00:00
|
|
|
style = stof(strKey);
|
2019-03-13 20:56:43 +00:00
|
|
|
break;
|
|
|
|
case "color":
|
2019-03-19 19:01:24 +00:00
|
|
|
color = stov(strKey);
|
2019-03-13 20:56:43 +00:00
|
|
|
break;
|
|
|
|
case "movetype":
|
2019-03-19 19:01:24 +00:00
|
|
|
movetype = stof(strKey);
|
2019-03-13 20:56:43 +00:00
|
|
|
break;
|
|
|
|
case "solid":
|
2019-03-19 19:01:24 +00:00
|
|
|
solid = stof(strKey);
|
2019-03-13 20:56:43 +00:00
|
|
|
break;
|
|
|
|
case "scale":
|
2019-03-19 19:01:24 +00:00
|
|
|
scale = stof(strKey);
|
2019-03-13 20:56:43 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
//dprint(sprintf("Unknown field %s, value %s\n", strField, strKey));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CBaseEntity::Init(void)
|
|
|
|
{
|
|
|
|
for (int i = 0; i < (tokenize(__fullspawndata) - 1); i += 2) {
|
|
|
|
//dprint(sprintf("SpawnData: %s %s\n", argv(i), argv(i+1)));
|
|
|
|
SpawnKey(argv(i), argv(i+1));
|
|
|
|
}
|
2019-03-14 19:13:02 +00:00
|
|
|
Initialized();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CBaseEntity::Initialized(void)
|
|
|
|
{
|
2019-03-13 20:56:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CBaseEntity::CBaseEntity(void)
|
|
|
|
{
|
|
|
|
}
|