View Single Post
nergal
Veteran Member
Join Date: Apr 2012
Old 08-23-2016 , 18:43   Re: New API and Syntax
Reply With Quote #754

Quote:
Originally Posted by Emp` View Post
?


PHP Code:
enum BaseBoss
{
    
Boss_Zero
}

BaseBoss preselected;        /* The next player chosen as boss */

methodmap VSHGameMode        /* all game mode oriented code should be handled HERE ONLY */
{
    public 
VSHGameMode()
    {
        
preselected Boss_Zero;
    }
    public 
BaseBoss GetRandomBoss(const bool balive)
    {
        
BaseBoss boss;
        for (
int i=MaxClients ; --i) {
            if (
not IsValidClient(i) )
                continue;
            if (
balive and not IsPlayerAlive(i))
                continue;
            
boss BaseBoss(i);
            if (
not boss.bIsBoss)
                continue;
            else return 
boss;
        }
        return 
Boss_Zero;
    }

BaseBoss is not an enum, it's a methodmap. Are you saying I need to make an enum everytime I require a null, non-Handle-based methodmap instance? Especially for methodmaps that aren't inheriting from another methodmap but needs to use data from them (other methodmaps).
__________________

Last edited by nergal; 08-23-2016 at 18:45.
nergal is offline