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); }
public Pipe(Vector2 pos) { position = pos; state = new UpPipeState(this); }
public Pipe(IPipeState state, Vector2 location) { this.state = state; position = location; }