public static void DrawSingle(int Index, Vector3 Position, float Size, Vector4 Color, Camera3D DrawCamera) { if (DrawItems.Count <= Index || DrawItems[Index] != null) { if (DrawItems.Count > Index) { DrawItems[Index] = new DrawShip(InstanceModelList.GetList()[Index]); } else { int c = DrawItems.Count; int numb = Index - c + 1; for (int i = 0; i < numb; i++) { if (i + c != Index) { DrawItems.Add(null); SortedChildren.Add(null); } else { DrawItems.Add(new DrawShip(InstanceModelList.GetList()[Index])); SortedChildren.Add(new LinkedList <BasicShipGameObject>()); } } } } DrawItems[Index].DrawSingle(Position, Size, Color, DrawCamera); }
public static float AddChild(BasicShipGameObject UnitShip) { if (DrawItems.Count > UnitShip.GetIntType()) { if (DrawItems[UnitShip.GetIntType()] != null) { SortedChildren[UnitShip.GetIntType()].AddLast(UnitShip); if (!DrawIdList.Contains(UnitShip.GetIntType())) { DrawIdList.AddLast(UnitShip.GetIntType()); } } else { DrawItems[UnitShip.GetIntType()] = UnitShip.getDrawItem(); if (DrawItems[UnitShip.GetIntType()] == null) { DrawItems.Add(new DrawShip(InstanceModelList.GetList()[UnitShip.GetIntType()])); } SortedChildren[UnitShip.GetIntType()] = new LinkedList <BasicShipGameObject>(); SortedChildren[UnitShip.GetIntType()].AddLast(UnitShip); DrawIdList.AddLast(UnitShip.GetIntType()); if (!DrawIdList.Contains(UnitShip.GetIntType())) { DrawIdList.AddLast(UnitShip.GetIntType()); } } } else { int c = DrawItems.Count; int numb = UnitShip.GetIntType() - c + 1; for (int i = 0; i < numb; i++) { if (i + c != UnitShip.GetIntType()) { DrawItems.Add(null); SortedChildren.Add(null); } else { DrawItems.Add(UnitShip.getDrawItem()); if (DrawItems[UnitShip.GetIntType()] == null) { DrawItems.Add(new DrawShip(InstanceModelList.GetList()[UnitShip.GetIntType()])); } SortedChildren.Add(new LinkedList <BasicShipGameObject>()); SortedChildren[UnitShip.GetIntType()].AddLast(UnitShip); if (!DrawIdList.Contains(UnitShip.GetIntType())) { DrawIdList.AddLast(UnitShip.GetIntType()); } } } } DrawShip r = (DrawShip)DrawItems[UnitShip.GetIntType()]; return(r.ShipScale / 1.2f); }
public DrawWall(string Fname) { Children = new LinkedList <WallItem>(); drawShip = new DrawShip(Fname); this.Fname = Fname; }