HashCode() публичный статический Метод

public static HashCode ( int hash ) : string
hash int
Результат string
Пример #1
0
        private static bool checkBlocks()
        {
            List <string> missing = new List <string>();

            for (int i = 0; i < 256; i++)
            {
                if (ignoreBlock(i))
                {
                    continue;
                }
                if (!tileNum.ContainsKey(i))
                {
                    missing.Add(Utils.HashCode(i));
                }
            }

            int[] wides = { 165, 231, 189 };

            for (int i = 0; i < 3; i++)
            {
                if (!wideTileNum.ContainsKey(wides[i]))
                {
                    missing.Add("W" + Utils.HashCode(wides[i]));
                }
            }


            for (int i = 0; i < 4; i++)
            {
                if (adapterNum[i] == -1)
                {
                    char c = Directions.ToChar(i);
                    if (i == Directions.North || i == Directions.South)
                    {
                        missing.Add(c + "10100101");
                    }
                    else
                    {
                        missing.Add(c + "11100111");
                    }
                }
            }

            if (missing.Count > 0)
            {
                FOCommon.Utils.Log(
                    string.Format("The following tiles are missing from block.txt: {0}.",
                                  string.Join(", ", missing.ToArray())));
                return(false);
            }
            return(true);
        }
Пример #2
0
        private void compileNormalCorridor(FOMap m, Preset p, int tx, int ty)
        {
            Tile tile = tiles[tx, ty];
            int  hash = GetTileHash(tile);
            int  num  = PresetsManager.GetNum(hash);

            if (num == -1)
            {
                throw new CompilerException(
                          String.Format("there is no tile for hash {0,8} to place on ({1},{2})", Utils.HashCode(hash), tx, ty));
            }

            BigTile bt = p.GetBigTile(num, tile.Variant);

            if (bt == null)
            {
                throw new CompilerException(
                          String.Format("there is no tile {0,8}/{1} to place on ({2},{3})", Utils.HashCode(hash), tile.Variant, tx, ty));
            }
            placeBigTile(m, bt, tx, ty);
        }