Ejemplo n.º 1
0
 public SnakeBuilder(ISkinFactory skinFactory, IPosition position)
 {
     this.skinFactory = skinFactory;
     this.segments    = new List <AbstractSnakeSegment> {
         new HeadSegment(skinFactory.CreateHeadSkin(), position)
     };
 }
Ejemplo n.º 2
0
        public ISnake Build()
        {
            foreach (var segment in segments)
            {
                segment.ChangeSkin(skinFactory.CreateBodySkin());
            }

            segments[0].ChangeSkin(skinFactory.CreateHeadSkin());

            return(new Snake(segments));
        }