Esempio n. 1
0
        public Detector AddDetector(DetectorType type)
        {
            IDetector d;

            switch (type)
            {
            case DetectorType.NPC:
                d = new NPCDetector(settings);
                break;

            case DetectorType.Object:
                d = new ObjectDetector(settings);
                break;

            case DetectorType.FarmAnimal:
                d = new FarmAnimalDetector(settings);
                break;

            case DetectorType.WaterEntity:
                d = new WaterEntityDetector(settings);
                break;

            case DetectorType.Crop:
                d = new CropDetector(settings);
                break;

            default:
                return(this);
            }
            detectors.Add(type, d);
            return(this);
        }
Esempio n. 2
0
        public Detector AddDetector(string type)
        {
            IDetector d = null;

            switch (type)
            {
            case "NPC":
                d = new NPCDetector(settings);
                break;

            case "Object":
                d = new ObjectDetector(settings);
                break;

            case "FarmAnimal":
                d = new FarmAnimalDetector(settings);
                break;

            case "WaterEntity":
                d = new WaterEntityDetector(settings);
                break;

            case null:
                return(this);
            }
            detectors.Add(type, d);
            return(this);
        }