public void AddToBoard(Board board, Vector2 v) { if(this.board == null) { ongrid = true; this.board = board; this.gridx = (int) v.X; this.gridy = (int) v.Y; board.AddComponent(this, v); } }
public BoardComponent(Vector2 v, Board board) : base() { SetGridPosition(v); width = 1; height = 1; tex = MetaData.TextureBank.GetSave("generic chip"); if(board != null) AddToBoard(board, v); SetData(); }
public BoardComponent(int x, int y, Board board) : this(new Vector2(x, y), board) { }
//If there is a Board remove it an Remove this from Board public void RemoveFromBoard() { if(board != null) { ongrid = false; Board b = board; board = null; b.RemoveComponent(this); } }