private IEnumerable <BasePrediction> GetPredictionsByType(PredictionType type) { switch (type) { case PredictionType.DangerCell: return(DangerCellPredictions.Select(x => (BasePrediction)x)); case PredictionType.MyKill: return(MyKillPredictions.Select(x => (BasePrediction)x)); case PredictionType.MyShot: return(MyShotPredictions.Select(x => (BasePrediction)x)); case PredictionType.MyMove: return(MyMovePredictions.Select(x => (BasePrediction)x)); case PredictionType.AiShot: return(AiShotPredictions.Select(x => (BasePrediction)x)); case PredictionType.Bullet: return(BulletPredictions.Select(x => (BasePrediction)x)); case PredictionType.AiMove: return(AiMovePredictions.Select(x => (BasePrediction)x)); case PredictionType.EnemyShot: return(EnemyShotPredictions.Select(x => (BasePrediction)x)); case PredictionType.EnemyMove: return(EnemyMovePredictions.Select(x => (BasePrediction)x)); default: throw new ArgumentOutOfRangeException(nameof(type), type, null); } }
public BasePrediction Add(PredictionType type, int depth, Point point, List <Command> commands = null, BaseItem item = null) { var prediction = PredictionFactory.Get(type, depth, point, commands, item); switch (type) { case PredictionType.AiMove: AiMovePredictions.Add((AiMovePrediction)prediction); break; case PredictionType.AiShot: AiShotPredictions.Add((AiShotPrediction)prediction); break; case PredictionType.Bullet: BulletPredictions.Add((BulletPrediction)prediction); break; case PredictionType.EnemyMove: EnemyMovePredictions.Add((EnemyMovePrediction)prediction); break; case PredictionType.EnemyShot: EnemyShotPredictions.Add((EnemyShotPrediction)prediction); break; case PredictionType.MyMove: MyMovePredictions.Add((MyMovePrediction)prediction); break; case PredictionType.MyShot: MyShotPredictions.Add((MyShotPrediction)prediction); break; case PredictionType.MyKill: MyKillPredictions.Add((MyKillPrediction)prediction); break; case PredictionType.DangerCell: DangerCellPredictions.Add((DangerCellPrediction)prediction); break; default: throw new NotImplementedException(); } return(prediction); }
public void Clear(bool clearMySelectedKills = false) { AiMovePredictions.Clear(); AiShotPredictions.Clear(); BulletPredictions.Clear(); EnemyMovePredictions.Clear(); EnemyShotPredictions.Clear(); MyMovePredictions.Clear(); MyShotPredictions.Clear(); MyKillPredictions.Clear(); DangerCellPredictions.Clear(); if (clearMySelectedKills) { MySelectedKillPredictions.Clear(); } InitLazyPredictions(); }