Ejemplo n.º 1
0
        internal void Fill()
        {
            switch (GlassState)
            {
            case GlassStateEnum.Empty:
                GlassState = GlassStateEnum.HalfFull;
                break;

            case GlassStateEnum.HalfFull:
                GlassState = GlassStateEnum.Full;
                break;

            case GlassStateEnum.Full:
                throw new ArgumentOutOfRangeException($"Glass is already full!");

            case GlassStateEnum.Removed:
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Ejemplo n.º 2
0
 public Glass(Coordinate coordinate, GlassStateEnum glassState)
 {
     Coordinate = coordinate;
     GlassState = glassState;
 }