Ejemplo n.º 1
0
 public void Add(IFortressComponent component)
 {
     componentsByZOrder.Add(new ComponentKey(component), component);
     foreach (var h in component.Position.Hardpoints)
     {
         if (!componentsByHardpoint.ContainsKey(h))
         {
             componentsByHardpoint[h] = new List <IFortressComponent>();
         }
         componentsByHardpoint[h].Add(component);
     }
 }
Ejemplo n.º 2
0
        private FortressLayout CreateDummyFortress()
        {
            var dummyComponents = new IFortressComponent[]
            {
                FoundationComponent.AtCenterPoint(new Hardpoint(1, 1, 0)),
                FoundationComponent.AtCenterPoint(new Hardpoint(3, 1, 0)),
                FoundationComponent.AtCenterPoint(new Hardpoint(1, 3, 0)),
                FoundationComponent.AtCenterPoint(new Hardpoint(3, 3, 0)),
                PillarComponent.AtPoint(new Hardpoint(2, 2, 0))
            };

            return(new FortressLayout(dummyComponents));
        }
Ejemplo n.º 3
0
 public ComponentKey(IFortressComponent component)
 {
     Component  = component;
     TiebreakId = Interlocked.Increment(ref componentCounter);
 }