/** * Make a (farm) field tile. * @param t the tile to make a farm field * @param field_type the 'growth' level of the field * @param industry the industry this tile belongs to */ public static void MakeField(this TileIndex t, uint field_type, IndustryID industry) { TileMap.SetTileType(t, TileType.MP_CLEAR); Map._m[t].m1 = 0; TileMap.SetTileOwner(t, Owner.OWNER_NONE); Map._m[t].m2 = industry; Map._m[t].m3 = (byte)field_type; Map._m[t].m4 = 0 << 5 | 0 << 2; SetClearGroundDensity(t, ClearGround.CLEAR_FIELDS, 3); Map._me[t].m6 = BitMath.SB(Map._me[t].m6, 2, 4, 0); Map._me[t].m7 = 0; }
/** * Set the industry (farm) that made the field * @param t the field to get creating industry of * @param i the industry that made the field * @pre GetClearGround(t) == CLEAR_FIELDS */ public static void SetIndustryIndexOfField(this TileIndex t, IndustryID i) { Debug.Assert(GetClearGround(t) == ClearGround.CLEAR_FIELDS); Map._m[t].m2 = i; }