// helps to get rid of first time zed spawn lags
// source: https://github.com/poosh/KF-ScrnBalance/blob/master/Classes/ScrnGameLength.uc#L190
class o_AssetLoader extends object;


// ====================================================
// contains all vanilla zeds for easy access
var array < class<KFMonster> > ZedsArray_std;
var array < class<KFMonster> > ZedsArray_xmas;
var array < class<KFMonster> > ZedsArray_halow;
var array < class<KFMonster> > ZedsArray_circus;


// ====================================================
// tbh when we load vanilla zed assets, it removes most of the hitches
// but let's set all variants if we ever need them
final static function LoadZedAsset(string event, LevelInfo Level)
{
  local int i;
  local array < class<KFMonster> > tmpZedsArray;

  // failsafe
  if (level == none)
    return;

  if (event ~= "c")
    tmpZedsArray = default.ZedsArray_circus;
  else if (event ~= "h")
    tmpZedsArray = default.ZedsArray_halow;
  else if (event ~= "x")
    tmpZedsArray = default.ZedsArray_xmas;
  // by default load standard zed assets
  else
    tmpZedsArray = default.ZedsArray_std;

  for (i = 0; i < tmpZedsArray.length && Level != none; i++)
  {
    tmpZedsArray[i].static.PreCacheAssets(Level);
    // log(string(tmpZedsArray[i]) $ " assets cached!!");
  }
}


// ====================================================

defaultproperties
{
     ZedsArray_std(0)=Class'KFChar.ZombieClot_STANDARD'
     ZedsArray_std(1)=Class'KFChar.ZombieCrawler_STANDARD'
     ZedsArray_std(2)=Class'KFChar.ZombieFleshpound_STANDARD'
     ZedsArray_std(3)=Class'KFChar.ZombieScrake_STANDARD'
     ZedsArray_std(4)=Class'KFChar.ZombieSiren_STANDARD'
     ZedsArray_std(5)=Class'KFChar.ZombieStalker_STANDARD'
     ZedsArray_std(6)=Class'KFChar.ZombieHusk_STANDARD'
     ZedsArray_std(7)=Class'KFChar.ZombieBloat_STANDARD'
     ZedsArray_std(8)=Class'KFChar.ZombieBoss_STANDARD'
     ZedsArray_std(9)=Class'KFChar.ZombieGorefast_STANDARD'
     ZedsArray_xmas(0)=Class'KFChar.ZombieCLot_XMas'
     ZedsArray_xmas(1)=Class'KFChar.ZombieCrawler_XMas'
     ZedsArray_xmas(2)=Class'KFChar.ZombieFleshPound_XMas'
     ZedsArray_xmas(3)=Class'KFChar.ZombieScrake_XMas'
     ZedsArray_xmas(4)=Class'KFChar.ZombieSiren_XMas'
     ZedsArray_xmas(5)=Class'KFChar.ZombieStalker_XMas'
     ZedsArray_xmas(6)=Class'KFChar.ZombieHusk_XMas'
     ZedsArray_xmas(7)=Class'KFChar.ZombieBloat_XMas'
     ZedsArray_xmas(8)=Class'KFChar.ZombieBoss_XMas'
     ZedsArray_xmas(9)=Class'KFChar.ZombieGoreFast_XMas'
     ZedsArray_halow(0)=Class'KFChar.ZombieClot_HALLOWEEN'
     ZedsArray_halow(1)=Class'KFChar.ZombieCrawler_HALLOWEEN'
     ZedsArray_halow(2)=Class'KFChar.ZombieFleshPound_HALLOWEEN'
     ZedsArray_halow(3)=Class'KFChar.ZombieScrake_HALLOWEEN'
     ZedsArray_halow(4)=Class'KFChar.ZombieSiren_HALLOWEEN'
     ZedsArray_halow(5)=Class'KFChar.ZombieStalker_HALLOWEEN'
     ZedsArray_halow(6)=Class'KFChar.ZombieHusk_HALLOWEEN'
     ZedsArray_halow(7)=Class'KFChar.ZombieBloat_HALLOWEEN'
     ZedsArray_halow(8)=Class'KFChar.ZombieBoss_HALLOWEEN'
     ZedsArray_halow(9)=Class'KFChar.ZombieGorefast_HALLOWEEN'
     ZedsArray_circus(0)=Class'KFChar.ZombieClot_CIRCUS'
     ZedsArray_circus(1)=Class'KFChar.ZombieCrawler_CIRCUS'
     ZedsArray_circus(2)=Class'KFChar.ZombieFleshPound_CIRCUS'
     ZedsArray_circus(3)=Class'KFChar.ZombieScrake_CIRCUS'
     ZedsArray_circus(4)=Class'KFChar.ZombieSiren_CIRCUS'
     ZedsArray_circus(5)=Class'KFChar.ZombieStalker_CIRCUS'
     ZedsArray_circus(6)=Class'KFChar.ZombieHusk_CIRCUS'
     ZedsArray_circus(7)=Class'KFChar.ZombieBloat_CIRCUS'
     ZedsArray_circus(8)=Class'KFChar.ZombieBoss_CIRCUS'
     ZedsArray_circus(9)=Class'KFChar.ZombieGoreFast_CIRCUS'
}
