public Grid(Vector2 setSize, Vector2 setPosition, GPoint.PType fillType) { xyMax = setSize + new Vector2 (1.0f, 1.0f); gridType = fillType; //bump up the size to create room for the buffer; SetSize (setSize + new Vector2 (2.0f, 2.0f)); //translate SetPosition (setPosition); Debug.Log ("creating a " + setSize.x + "by" + setSize.y + " grid, filled with " + fillType); //Debug.Log ("actually a " + size.x + "by" + size.y + " grid"); //create [,] of empty points Initialize (); //add a buffer MarkBuffer (); //fill the center Fill (gridType); }
public Grid(Grid g) { //Vector2 setSize, Vector2 setPosition, GPoint.PType fillType xyMax = g.xyMax; gridType = g.gridType; //bump up the size to create room for the buffer; size = g.size; //translate position = g.position; //Debug.Log ("creating a grid FROM a grid " + g.GetSize ().x + "by" + g.GetSize ().y + " grid, filled with " + g.gridType); //Debug.Log ("actually a " + size.x + "by" + size.y + " grid"); //create [,] of empty points Initialize (); //add a buffer MarkBuffer (); //fill the center //Fill (gridType); UpdatePoints (g.GetPoints ()); }
void UpdateType(GPoint.PType newType) { type = newType; }