private PassiveNPC FindPassiveByID(int id) { List <PassiveNPC> pTypes = PassiveTypes; PassiveNPC p = pTypes.Find(x => x.ID == id); return(p); }
public void CreateListsOfNPCs() { bool isMerchantSpawning = ShouldMerchantSpawn(); if (isMerchantSpawning == true) { PassiveNPC merchant = FindPassiveByID(0); PassiveNPC p = new PassiveNPC(merchant.ID, merchant.Name, merchant.LocationID, merchant.TilePosition, merchant.Icon, merchant.RoleDescriptor); PassiveNPCs.Add(p); Gamestate.TimeSinceMerchantSpawn = 0; GivePassivesPositions(); } int enemyCount = NumberOfEnemiesToSpawn(); EnemyNPCs = GetEnemiesForList(enemyCount); GiveEnemiesPositions(); }