protected override void ExecuteSystem(List <GameEntity> entities) { bool conditionFulfilled = true; foreach (GameEntity gameEntity in _kittenGroup.GetEntities()) { if (!gameEntity.isHasBeenPet) { conditionFulfilled = false; break; } } if (conditionFulfilled) { WinConditionComponent winConditions = _context.winCondition; for (var i = 0; i < winConditions.WinConditions.Length; i++) { WinConditionState currentWinCondition = winConditions.WinConditions[i]; if (currentWinCondition.WinCondition == WinCondition.KittenPet) { winConditions.WinConditions[i].IsFulfilled = true; break; } } _context.ReplaceWinCondition(_context.winCondition.ConditionModifier, winConditions.WinConditions); } }
protected override void ExecuteSystem(List <GameEntity> entities) { WinConditionComponent winConditions = _context.winCondition; for (var i = 0; i < winConditions.WinConditions.Length; i++) { WinConditionState currentWinCondition = winConditions.WinConditions[i]; if (currentWinCondition.WinCondition == WinCondition.KillEnemies) { winConditions.WinConditions[i].IsFulfilled = true; break; } } _context.ReplaceWinCondition(_context.winCondition.ConditionModifier, winConditions.WinConditions); }