func (gen RoomsGenerator) markLocationAsFinish(room *g.Room, location *g.Location) { cellsCount := len(location.CellsMap) idx := cellsCount / 2 location.CellsMap[idx] = "&" triggerX, triggerY := g.CellIdxToXY(idx, location.SizeX) exitTrigger := g.CreateExitTrigger(*g.NewPosObj(location, triggerX, triggerY)) room.AddTrigger(exitTrigger) room.ExitLocationID = location.RefID() }