Exemple #1
0
        public Pipe build(PipeFacing type, Vector2 location)
        {
            if (type == PipeFacing.up)
            {
                state = new UpPipeState();
            }
            if (type == PipeFacing.down)
            {
                state = new DownPipeState();
            }
            if (type == PipeFacing.left)
            {
                state = new LeftPipeState();
            }
            Pipe product = new Pipe(state, location);

            return(product);
        }
Exemple #2
0
 public Pipe(Vector2 pos)
 {
     position = pos;
     state    = new UpPipeState(this);
 }
Exemple #3
0
 public Pipe(IPipeState state, Vector2 location)
 {
     this.state = state;
     position   = location;
 }