private void CreatePlanet(PlanetCreationRequest request)
 {
     lock (GameObjectsLock)
     {
         var item = new Planet(Bus);
         GameObjects.Add(item);
         for (int x = 0; x < request.PlanetSize; ++x)
         {
             for (int y = 0; y < request.PlanetSize; ++y)
             {
                 for (int z = 0; z < request.PlanetSize; ++z)
                 {
                     if ((Math.Pow(x - (request.PlanetSize - 1) / 2.0, 2) + Math.Pow(y - (request.PlanetSize - 1) / 2.0, 2) + Math.Pow(z - (request.PlanetSize - 1) / 2.0, 2) - Math.Pow(request.PlanetSize / 2.0, 2)) <= 0)
                     {
                         var child = new VoxelGreen(_idTally++, Bus)
                         {
                             Position = new Vect3(x, y, z)
                         };
                         GameObjects.Add(child);
                         item.AddChild(child);
                     }
                 }
             }
         }
     }
 }
        public void PlanetAddChild()
        {
            Planet currentPlanet = new Planet();

            SolarSystem tempSolarSystem = new SolarSystem();
            bool        addSolarSystem  = currentPlanet.AddChild(tempSolarSystem);

            Assert.AreEqual(false, addSolarSystem);

            Binary tempBinary = new Binary();
            bool   addBinary  = currentPlanet.AddChild(tempBinary);

            Assert.AreEqual(false, addBinary);

            Star tempStar = new Star();
            bool addStar  = currentPlanet.AddChild(tempStar);

            Assert.AreEqual(false, addStar);

            Planet tempPlanet = new Planet();
            bool   addPlanet  = currentPlanet.AddChild(tempPlanet);

            Assert.AreEqual(false, addPlanet);
        }