Exemple #1
0
 public Artillery() : base(6, 12, 2, 2)
 {
     Type         = Unit.Artillery;
     Name         = "Artillery";
     RequiredTech = new Robotics();
     ObsoleteTech = null;
     SetIcon('B', 0, 0);
 }
Exemple #2
0
 public MfgPlant() : base(32, 6)
 {
     Name         = "Mfg. Plant";
     RequiredTech = new Robotics();
     SetIcon(3, 2, true);
     SetSmallIcon(3, 0);
     Type = Building.MfgPlant;
 }
Exemple #3
0
 public Cannon() : base(4, 8, 1, 1)
 {
     Type         = UnitType.Cannon;
     Name         = "Cannon";
     RequiredTech = new Metallurgy();
     ObsoleteTech = new Robotics();
     SetIcon('B', 1, 2);
 }
Exemple #4
0
        static void Main(string[] args)
        {
            // Console.WriteLine("Please insert the number of instructions:");

            int instructionsCount = Convert.ToInt32(Console.ReadLine());

            // Console.WriteLine("Please insert the starting coordinates");
            string[] coordinates = Console.ReadLine().Split(' ');

            int x;

            int.TryParse(coordinates[0], out x);

            int y;

            int.TryParse(coordinates[1], out y);

            int[] coordinate = new[] { x, y };


            // Console.WriteLine("Please insert the Direction and Steps:");

            List <Tuple <string, int> > directionList = new List <Tuple <string, int> >();

            int counter = 0;

            while (counter < instructionsCount)
            {
                var    direction        = Console.ReadLine().Split(' ');
                string compassDirection = direction[0];
                int    steps            = Convert.ToInt32(direction[1]);
                directionList.Add(new Tuple <string, int>(compassDirection, steps));
                counter++;
            }

            Robot cintRobot = new Robot(coordinate, directionList);

            Robotics robotics = new Robotics(cintRobot);

            int cleanedCount = robotics.CountCleanedSpots();

            Console.WriteLine("=> Cleaned: {0}", cleanedCount);

            Console.Read();
        }
Exemple #5
0
 public SSModule() : base(32)
 {
     Name         = "SS Module";
     RequiredTech = new Robotics();
     Type         = Building.SSModule;
 }
Exemple #6
0
		public void SetRobotEdit(Robotics.Robot robot, ContentManager cmgr) 
		{
			RobotEdit.SelectedRobot = robot;	
			RobotEdit.ContentManager= cmgr;
		}
Exemple #7
0
 public void ConnectTo (Robotics.Messaging.ControlServer server, bool writeable = false, string name = null)
 {
     var v = server.RegisterVariable (
         name ?? FullNameWithUnits,
         Value,
         writeable ? (Robotics.Messaging.VariableChangedAction)(x => Value = x.DoubleValue) : null);
     ValueChanged += (s, e) => v.Value = Value;
 }
Exemple #8
0
        public static string Serialize(Robotics.HAL.Sensors.Telemetric.LaserReading[] readings)
        {
            if ((readings == null) || (readings.Length < 2))
                return null;

            int count = readings.Length;
            double min = readings[0].Angle;
            double step = readings[1].Angle - readings[0].Angle;
            ushort distanceMM;
            int i;
            byte[] bytes;

            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            bytes = BitConverter.GetBytes(count);
            for(i =0; i < bytes.Length; ++i)
                sb.AppendFormat("{0:x2}", bytes[i]);

            bytes = BitConverter.GetBytes(min);
            for (i = 0; i < bytes.Length; ++i)
                sb.AppendFormat("{0:x2}", bytes[i]);

            bytes = BitConverter.GetBytes(step);
            for (i = 0; i < bytes.Length; ++i)
                sb.AppendFormat("{0:x2}", bytes[i]);

            for(i = 0; i < count; ++i)
            {
                distanceMM = (ushort)readings[i].DistanceMillimeters;
                if (readings[i].Mistaken)
                    distanceMM |= 0x8000;
                bytes = BitConverter.GetBytes(distanceMM);
                sb.AppendFormat("{0:x2}", bytes[0]);
                sb.AppendFormat("{0:x2}", bytes[1]);
            }
            return sb.ToString();
        }
 public static void SetAdapter(Robotics.Mobile.Core.Bluetooth.LE.IAdapter adapter)
 {
     Adapter = adapter;
 }