コード例 #1
0
        public static Position ThreeByThreeCenteredAt(Hardpoint center)
        {
            var hardpoints = new List <Hardpoint>();

            for (int x = center.X - 1; x <= center.X + 1; x++)
            {
                for (int y = center.Y - 1; y <= center.Y + 1; y++)
                {
                    hardpoints.Add(new Hardpoint(x, y, center.Z));
                }
            }
            return(new Position(hardpoints));
        }
コード例 #2
0
 public static FoundationComponent AtCenterPoint(Hardpoint centerPoint)
 {
     return(new FoundationComponent(Position.ThreeByThreeCenteredAt(centerPoint)));
 }
コード例 #3
0
 public IEnumerable <IFortressComponent> ComponentsByHardpoint(Hardpoint h)
 {
     return(componentsByHardpoint.ContainsKey(h) ? componentsByHardpoint[h] : Enumerable.Empty <IFortressComponent>());
 }
コード例 #4
0
 public static PillarComponent AtPoint(Hardpoint point)
 {
     return(new PillarComponent(Position.OneByOneAt(point)));
 }
コード例 #5
0
 public static Position OneByOneAt(Hardpoint point)
 {
     return(new Position(new[] { point }));
 }