Esempio n. 1
0
 public Engine(IGridCreator gridCreator, ITargetStrategy targetStrategy, IConfigService configService, ILogger <Engine> logger)
 {
     _gridCreator    = gridCreator;
     _targetStrategy = targetStrategy;
     _configService  = configService;
     _logger         = logger;
 }
Esempio n. 2
0
 public Player(IGridCreator gridCreator, ITargetStrategy _targetStrategy, int gridSize, IEnumerable <ShipPrototype> ships, string playerName)
 {
     targetStrategy = _targetStrategy;
     PlayerGrid     = gridCreator.Create(GridType.Main, gridSize, ships);
     OpponentGrid   = gridCreator.Create(GridType.Opponent, gridSize);
     Name           = playerName;
 }
Esempio n. 3
0
 protected Tower(Board board, int indexOnBoard)
 {
     instanceId = idGenerator++;
     this.board = board;
     this.indexOnBoard = indexOnBoard;
     stats = new TowerStats();
     effects = new LinkedList<ITowerEffect>();
     targetStrategy = new NearestMinionTargetStrategy();
 }
        public static IDictionary <string, string> Convert(ITargetStrategy strategy)
        {
            var result = new Dictionary <string, string>();
            var types  = strategy?.DetectedTypes;

            if (types != null)
            {
                var fakes         = LoadFakesFiles(strategy?.FoundFakesConfiguration);
                var configuration = new Dictionary <string, XElement>();
                foreach (var fakeType in types.Keys)
                {
                    foreach (var type in types[fakeType])
                    {
                        var assemblyName = type?.Assembly.GetName();
                        var baseName     = assemblyName?.Name;
                        if (string.IsNullOrWhiteSpace(baseName))
                        {
                            continue;
                        }

                        if (!configuration.ContainsKey(baseName))
                        {
                            XElement compilation = null;
                            if (fakes.ContainsKey(baseName))
                            {
                                compilation = fakes[baseName].Element(Compilation);
                            }

                            configuration[baseName] = CreateBaseFakeElement(baseName, AssemblyVersion(assemblyName), compilation);
                        }

                        var baseElement = configuration[baseName];
                        AddTypeToBaseElement(baseElement, type, fakeType);
                    }
                }

                if (configuration.Count > 0)
                {
                    result = configuration.ToDictionary(x => x.Key, y => y.Value.ToString());
                }
            }

            return(result);
        }
Esempio n. 5
0
 public SingleFolder(string outputFolder, ITargetStrategy targetStrategy)
 {
     OutputFolder   = outputFolder;
     TargetStrategy = targetStrategy;
 }
Esempio n. 6
0
 protected Tower()
 {            
     stats = new TowerStats();
     effects = new LinkedList<ITowerEffect>();
     targetStrategy = new NearestMinionTargetStrategy();
 } 
Esempio n. 7
0
 public ChaseTargetStrategy(ITargetStrategy targetStrategy, ICreatureMovementStrategy movementStrategy)
 {
     this.targetStrategy   = targetStrategy;
     this.movementStrategy = movementStrategy;
 }
Esempio n. 8
0
 protected Tower()
 {
     stats          = new TowerStats();
     effects        = new LinkedList <ITowerEffect>();
     targetStrategy = new NearestMinionTargetStrategy();
 }