MCPcopy Create free account
hub / github.com/NetHack/NetHack / selection_size_description

Function selection_size_description

src/selvar.c:763–778  ·  view source on GitHub ↗

return a description of the selection size */

Source from the content-addressed store, hash-verified

761
762/* return a description of the selection size */
763char *
764selection_size_description(struct selectionvar *sel, char *buf)
765{
766 NhRect rect = cg.zeroNhRect;
767 coordxy dx, dy;
768
769 selection_getbounds(sel, &rect);
770 dx = rect.hx - rect.lx + 1;
771 dy = rect.hy - rect.ly + 1;
772 Sprintf(buf, "%s %i by %i",
773 selection_is_irregular(sel) ? "irregularly shaped"
774 : (dx == dy) ? "square"
775 : "rectangular",
776 dx, dy);
777 return buf;
778}
779
780struct selectionvar *
781selection_from_mkroom(struct mkroom *croom)

Callers 2

lookaround_known_roomFunction · 0.85

Calls 2

selection_getboundsFunction · 0.85
selection_is_irregularFunction · 0.85

Tested by

no test coverage detected