public void MergeRoom(AP_Room r, int id) { Vector2 mergeDir = r.GetUnitPos() - GetUnitPos(); SetOpen(mergeDir); SetID(id); mMergedRooms.Add(r); }
public void ConnectRoom(AP_Room r) { Vector2 connectDir = r.GetUnitPos() - GetUnitPos(); if (connectDir.magnitude != 1) { print("Rooms not orthogonally adjacent, connect failed"); return; } ConnectRoom(connectDir); r.ConnectRoom(-connectDir); }
public void MergeRoom(AP_Room r) { Vector2 mergeDir = r.GetUnitPos() - GetUnitPos(); if (mergeDir.magnitude != 1) { print("Rooms not orthogonally adjacent, merge failed"); return; } MergeRoom(r, GetID()); r.MergeRoom(this, GetID()); }
public Door(AP_Room r, Vector2 dir) { origin = r.GetUnitPos(); doorDir = dir; newPos = origin + doorDir; }
bool isSpaceAvailable(AP_Room r, Vector2 dir) { return(isSpaceAvailable(r.GetUnitPos() + dir)); }