Пример #1
0
 public override string ToString()
 {
     return(NumberOfSides.ToString() + "-gon");
 }
Пример #2
0
        public int RemoveSide(int index)
        {
            int result = 0;

            if (index < 0)
            {
                throw new ArgumentException("Must count a side from at least 0.  You asked to remove a side less than the 0th side from a die.");
            }
            if (index < NumberOfSides)
            {
                result = SideSymbolIds[index];
                SideSymbolIds[index] = Blank;
                return(result);
            }
            throw new ArgumentException("Cannot reference side " + index.ToString() + ": only " + NumberOfSides.ToString() + " sides on this die.  (Sides counted from 0)");
        }