Ejemplo n.º 1
0
 public static PageRect RectFor(PageAddress addr)
 {
   PageRect ret = new PageRect();
   ret.X = addr.X * Page.TileSizeUnits;
   ret.Z = addr.Z * Page.TileSizeUnits;
   ret.W = Page.TileSizeUnits;
   ret.H = Page.TileSizeUnits;
   return ret;
 }
Ejemplo n.º 2
0
 public void AddPage(Page p)
 {
   if (pages_.Count == 0)
   {
     minAddress_ = p.Address;
     maxAddress_ = p.Address;
     bounds_ = p.Rect;
   }
   else
   {
     bounds_.Union(p.Rect);
     if (p.Address.X < minAddress_.X) minAddress_.X = p.Address.X;
     if (p.Address.Z < minAddress_.Z) minAddress_.Z = p.Address.Z;
     if (p.Address.X > maxAddress_.X) maxAddress_.X = p.Address.X;
     if (p.Address.Z > maxAddress_.Z) maxAddress_.Z = p.Address.Z;
   }
   p.SetOwner(this);
   pages_.Add(p.Address, p);
 }
Ejemplo n.º 3
0
 public void SetAddress(PageAddress addr, PageRect rect)
 {
     addr_ = addr;
     rect_ = rect;
 }
Ejemplo n.º 4
0
 internal Page(PageOwner owner, PageAddress addr)
 {
     addr_  = addr;
     owner_ = owner;
     rect_  = PageAddress.RectFor(addr);
 }
Ejemplo n.º 5
0
 public void SetAddress(PageAddress addr, PageRect rect)
 {
   addr_ = addr;
   rect_ = rect;
 }
Ejemplo n.º 6
0
 internal Page(PageOwner owner, PageAddress addr)
 {
   addr_ = addr;
   owner_ = owner;
   rect_ = PageAddress.RectFor(addr);
 }
Ejemplo n.º 7
0
 public Page PageAt(PageAddress pa)
 {
   Page ret = null;
   pages_.TryGetValue(pa, out ret);
   return ret;
 }