public ArrowedMenuPage(int nOptions, int baseX, int baseY) { PageOptions = new ArrowedMenuOption[nOptions]; NextOpenOptionSlotIndex = 0; PageBaseXCoord = baseX; PageBaseYCoord = baseY; }
// Returns whether the option was successfully added to the page. // Returns false if the page is full public bool AddNewOption(string optionString) { bool successful = false; if (NextOpenOptionSlotIndex < PageOptions.Length) { int newOptionX = PageBaseXCoord; int newOptionY = PageBaseYCoord + (NextOpenOptionSlotIndex * LINE_SPACING); PageOptions[NextOpenOptionSlotIndex] = new ArrowedMenuOption(newOptionX, newOptionY, optionString); ++NextOpenOptionSlotIndex; successful = true; } return(successful); }