<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def insert_tile(self, tile_info):
 """Add or replace an entry in the tile cache. Args: tile_info (TileInfo):
 The newly registered tile. """


        for i, tile in enumerate(self.registered_tiles):
            if tile.slot == tile_info.slot:
                self.registered_tiles[i] = tile_info
                return

        self.registered_tiles.append(tile_info)