コード例 #1
0
        //CreateShape
        public Shape CreateShape(Model.ShapeType type)
        {
            switch (type)
            {
            case Model.ShapeType.LINE:
                return(new Line());

            case Model.ShapeType.RECTANGLE:
                return(new Rectangle());

            case Model.ShapeType.HEXAGON:
                return(new Hexagon());

            default:
                return(null);
            }
        }
コード例 #2
0
 public DrawState(Model model, Model.ShapeType type)
 {
     _model = model;
     _hint  = _shapeFactory.CreateShape(type);
 }