Пример #1
0
 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);
     }
 }
Пример #2
0
 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();
 }
Пример #3
0
 public BoardComponent(int x, int y, Board board)
     : this(new Vector2(x, y), board)
 {
 }
Пример #4
0
 //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);
     }
 }