Example #1
0
    public void MergeRoom(AP_Room r, int id)
    {
        Vector2 mergeDir = r.GetUnitPos() - GetUnitPos();

        SetOpen(mergeDir);
        SetID(id);
        mMergedRooms.Add(r);
    }
Example #2
0
    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);
    }
Example #3
0
    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));
 }