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)