示例#1
0
        public Moon Copy()
        {
            var copy = new Moon(new Point(Position.X, Position.Y, Position.Z));

            copy.Velocity = new Point(Velocity.X, Velocity.Y, Velocity.Z);
            return(copy);
        }
示例#2
0
        static List <Moon> GetMoons(string[] input)
        {
            var moons = new List <Moon>();

            foreach (var line in input)
            {
                var moon = new Moon(new Point());

                var skipped = line.Split(' ');
                moon.Position.X = int.Parse(skipped[0].Replace("<x=", "").Replace(",", ""));
                moon.Position.Y = int.Parse(skipped[1].Replace("y=", "").Replace(",", ""));
                moon.Position.Z = int.Parse(skipped[2].Replace("z=", "").Replace(">", ""));

                moons.Add(moon);
            }

            return(moons);
        }
示例#3
0
 public MoonPair(Moon x, Moon y)
 {
     First  = x;
     Second = y;
 }
示例#4
0
 public bool Equals(Moon moon)
 {
     return(Position.Equals(moon.Position) && Velocity.Equals(moon.Velocity));
 }