示例#1
0
 public virtual void Add(Block3D item)
 {
     if (item != null)
     {
         Blocks.Add(item);
     }
 }
示例#2
0
 public static void WriteBlock3D(this GenericWriter writer, Block3D b)
 {
     writer.Write(b.X);
     writer.Write(b.Y);
     writer.Write(b.Z);
     writer.Write(b.H);
 }
示例#3
0
        public static IEnumerable <Block3D> Flatten(this IEnumerable <Block3D> blocks)
        {
            foreach (var o in blocks.ToLookup(o => o.ToPoint2D()))
            {
                var v = new Block3D(o.Key.X, o.Key.Y, o.Min(b => b.Z), 0);

                v.H = o.Max(b => b.Z + b.H) - v.Z;

                yield return(v);
            }
        }
示例#4
0
        public virtual bool Remove(Block3D item)
        {
            if (item == null)
            {
                return(false);
            }

            var success = Blocks.Remove(item);

            Blocks.Free(false);

            return(success);
        }
示例#5
0
        public static Wireframe GetWireframe(this MultiComponentList mcl)
        {
            if (mcl == null)
            {
                return(Wireframe.Empty);
            }

            var frame = new Block3D[mcl.List.Length];

            frame.SetAll(
                i =>
                new Block3D(
                    mcl.List[i].m_OffsetX,
                    mcl.List[i].m_OffsetY,
                    mcl.List[i].m_OffsetZ,
                    TileData.ItemTable[mcl.List[i].m_ItemID].CalcHeight + 5));

            return(new Wireframe(frame));
        }
示例#6
0
        public static Wireframe GetWireframe(this MultiComponentList mcl)
        {
            if (mcl == null)
            {
                return(Wireframe.Empty);
            }

            var frame = new Block3D[mcl.List.Length];

            frame.SetAll(
                i =>
            {
                var o = mcl.List[i];
                var h = Math.Max(5, TileData.ItemTable[o.m_ItemID].Height);

                return(new Block3D(o.m_OffsetX, o.m_OffsetY, o.m_OffsetZ, h));
            });

            return(new Wireframe(frame));
        }
示例#7
0
 public static bool Intersects(this IEntity e, IPoint3D o)
 {
     return(Block3D.Intersects(e, o));
 }
示例#8
0
 public Wireframe(int capacity)
 {
     Blocks = new Block3D[capacity];
 }
示例#9
0
 public bool Intersects(Block3D b)
 {
     return(Intersects(b.X, b.Y, b.Z, b.H));
 }
示例#10
0
 public virtual bool Remove(Block3D item)
 {
     return(Blocks.Remove(item));
 }
示例#11
0
 public virtual void Add(Block3D item)
 {
     Blocks.Add(item);
 }