Beispiel #1
0
        public static int GetCardId()
        {
            string  mapName = GlobalState.CURRENT_MAP_NAME;
            Vector2 gridPos = GlobalState.CurrentMapGrid;

            if (mapName == "NEXUS")
            {
                return(48);
            }

            if (!_cardLocations.ContainsKey(mapName))
            {
                DebugLogger.AddError($"No card data found for map {mapName}!");
                return(-1);
            }

            Dictionary <Vector2, int> mapCards = _cardLocations[mapName];

            if (!mapCards.ContainsKey(gridPos))
            {
                DebugLogger.AddError($"No card data at {gridPos.X}, {gridPos.Y} of map {mapName}!");
                return(-1);
            }

            return(mapCards[gridPos]);
        }
        protected void SetStreamreader(string path)
        {
            _stream = new FileStream(path, FileMode.Create);

            if (_stream != null)
            {
                _writer = new StreamWriter(_stream);
            }
            else
            {
                DebugLogger.AddError($"Unable to read content file: {FilePath}. File does not exist!");
            }
        }
 protected void ThrowFileError(string message)
 {
     DebugLogger.AddError(FormatFileError(message), false);
 }