Esempio n. 1
0
        public static DirectionsEightBit CalculateTileFlags8Bit(bool east, bool west, bool north, bool south, bool northWest, bool northEast, bool southWest, bool southEast)
        {
            DirectionsEightBit directions = (east ? DirectionsEightBit.East : 0) | (west ? DirectionsEightBit.West : 0) | (north ? DirectionsEightBit.North : 0) | (south ? DirectionsEightBit.South : 0);

            directions |= ((north && west) && northWest) ? DirectionsEightBit.NorthWest : 0;
            directions |= ((north && east) && northEast) ? DirectionsEightBit.NorthEast : 0;
            directions |= ((south && west) && southWest) ? DirectionsEightBit.SouthWest : 0;
            directions |= ((south && east) && southEast) ? DirectionsEightBit.SouthEast : 0;
            return(directions);
        }
Esempio n. 2
0
 public static int TileEightBitStandardConversion(DirectionsEightBit directions)
 {
     InitConversionDictionary();
     return(EightBitConversionDic[(int)directions]);
 }