Ejemplo n.º 1
0
Destructible *Destructible::Create(TCODZip &zip)
{
    DestructibleType type = (DestructibleType) zip.getInt();
    Destructible *destructible = NULL;
    switch(type) {
        case MONSTER:
            destructible = new MonsterDestructible(0, 0, NULL);
            break;
        case PLAYER:
            destructible = new PlayerDestructible(0, 0, NULL);
            break;
    }
    if (destructible != NULL) {
        destructible->Load(zip);
    }

    return destructible;
}
Ejemplo n.º 2
0
Destructible*
Destructible::Create(TCODZip& zip) {
    destructible_type type = (destructible_type)zip.getInt();
    Destructible* destructible = nullptr;

    switch(type) {
		case DESTRUCTIBLE_TYPE_ORC:
		{
			destructible = new OrcDestructible(0, 0);
		} break;

		case DESTRUCTIBLE_TYPE_PLAYER:
		{
			destructible = new PlayerDestructible(0, 0);
		} break;
	}

    destructible->Load(zip);

    return(destructible);
}