Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 3
0
 public bool Equals(Moon moon)
 {
     return(Position.Equals(moon.Position) && Velocity.Equals(moon.Velocity));
 }