示例#1
0
/**
 * Sets the increment stage of a house
 * It is working with the whole counter + stage 5 bits, making it
 * easier to work:  the wraparound is automatic.
 * @param t the tile of the house to increment the construction stage of
 * @pre TileMap.IsTileType(t, TileType.MP_HOUSE)
 */
        public static void IncHouseConstructionTick(this TileIndex t)
        {
            Debug.Assert(TileMap.IsTileType(t, TileType.MP_HOUSE));
            Map._m[t].m5 = BitMath.AB(Map._m[t].m5, 0, 5, 1);

            if (BitMath.GB(Map._m[t].m5, 3, 2) == TOWN_HOUSE_COMPLETED)
            {
                /* House is now completed.
                 * Store the year of construction as well, for newgrf house purpose */
                SetHouseCompleted(t, true);
            }
        }
示例#2
0
/**
 * Increase the progress counter of road works.
 * @param t The tile to modify.
 * @return True if the road works are in the last stage.
 */
        public static bool IncreaseRoadWorksCounter(this TileIndex t)
        {
            Map._me[t].m7 = BitMath.AB(Map._me[t].m7, 0, 4, 1);

            return(BitMath.GB(Map._me[t].m7, 0, 4) == 15);
        }