Esempio n. 1
0
 public VisibilityMap(VisibilityMap v)
 {
     for (int i = 0; i < v.XpYp.Count; i++)
     {
         XpYp.Add(new List <Chunk>());
         for (int j = 0; j < v.XpYp[i].Count; j++)
         {
             XpYp[i].Add(new Chunk(v.XpYp[i][j]));
         }
     }
     for (int i = 0; i < v.XpYn.Count; i++)
     {
         XpYn.Add(new List <Chunk>());
         for (int j = 0; j < v.XpYn[i].Count; j++)
         {
             XpYn[i].Add(new Chunk(v.XpYn[i][j]));
         }
     }
     for (int i = 0; i < v.XnYp.Count; i++)
     {
         XnYp.Add(new List <Chunk>());
         for (int j = 0; j < v.XnYp[i].Count; j++)
         {
             XnYp[i].Add(new Chunk(v.XnYp[i][j]));
         }
     }
     for (int i = 0; i < v.XnYn.Count; i++)
     {
         XnYn.Add(new List <Chunk>());
         for (int j = 0; j < v.XnYn[i].Count; j++)
         {
             XnYn[i].Add(new Chunk(v.XnYn[i][j]));
         }
     }
 }
Esempio n. 2
0
 public VisibilityMap(VisibilityMap v)
 {
     for (int i = 0; i < v.XpYp.Count; i++)
     {
         XpYp.Add(new List<Chunk>());
         for (int j = 0; j < v.XpYp[i].Count; j++)
         {
             XpYp[i].Add(new Chunk(v.XpYp[i][j]));
         }
     }
     for (int i = 0; i < v.XpYn.Count; i++)
     {
         XpYn.Add(new List<Chunk>());
         for (int j = 0; j < v.XpYn[i].Count; j++)
         {
             XpYn[i].Add(new Chunk(v.XpYn[i][j]));
         }
     }
     for (int i = 0; i < v.XnYp.Count; i++)
     {
         XnYp.Add(new List<Chunk>());
         for (int j = 0; j < v.XnYp[i].Count; j++)
         {
             XnYp[i].Add(new Chunk(v.XnYp[i][j]));
         }
     }
     for (int i = 0; i < v.XnYn.Count; i++)
     {
         XnYn.Add(new List<Chunk>());
         for (int j = 0; j < v.XnYn[i].Count; j++)
         {
             XnYn[i].Add(new Chunk(v.XnYn[i][j]));
         }
     }
 }
Esempio n. 3
0
 public static void Push()
 {
     if (!IsHistoryEnabled) return;
     for (int i = HISTORY_LENGTH - 1; i > 0; i--)
     {
         Components[i] = Components[i - 1];
         LightEmittingComponents[i] = LightEmittingComponents[i - 1];
         MagnetComponents[i] = MagnetComponents[i - 1];
         Layers[i] = Layers[i - 1];
         MapVisibility[i] = MapVisibility[i - 1];
         ComponentSelectorComponents[i] = ComponentSelectorComponents[i - 1];
         Colliders[i] = Colliders[i - 1];
     }
     Components[0] = new List<Component>(ComponentsManager.Components);
     LightEmittingComponents[0] = new List<ILightEmitting>(ComponentsManager.LightEmittingComponents);
     MagnetComponents[0] = new List<IMagnetic>(ComponentsManager.MagnetComponents);
     Layers[0] = new List<int>(ComponentsManager.Layers);
     MapVisibility[0] = new VisibilityMap(ComponentsManager.VisibilityMap);
     ComponentSelectorComponents[0] = MicroWorld.Graphics.GUI.GUIEngine.s_componentSelector.CloneTiles();
     Colliders[0] = MicroWorld.Components.ComponentsManager.collidersManager.PushColliders();
 }