Exemple #1
0
        public Hexagon RevealHexagonAt(HexagonPosition hexagonPosition)
        {
            if (Hexagons.ContainsKey(hexagonPosition))
            {
                throw new InvalidOperationException($"The hexagon was already revealed. Use Indexer or {nameof(GetHexagonAtPosition)} instead.");
            }
            var hexagon = HexagonRevealer.GenerateHexagonAt(hexagonPosition);

            Hexagons.Add(hexagonPosition, hexagon);
            HexagonRevealed?.Invoke(this, hexagon);
            return(hexagon);
        }
Exemple #2
0
 public HexagonManager(GameplaySettings gameplaySettings)
 {
     GameplaySettings = gameplaySettings;
     HexagonRevealer  = new HexagonRevealer(this, gameplaySettings);
 }