Esempio n. 1
0
        public MapList<ComplexTerrainEntity> GenerateMap()
        {
            int length = 10;
            int width = 10;

            MapList<ComplexTerrainEntity> result = new MapList<ComplexTerrainEntity>(length, width);

            int x = 0;
            int y = 0;

            while (x < length)
            {
                while (y < width)
                {
                    result.Put(GenerateEntity(result, x, y), x, y);

                    y++;
                }

                y = 0;

                x++;
            }

            Genero.Entities.MetaEntities.RoomMeta RoomGenerator = new Entities.MetaEntities.RoomMeta(5, 5);

            MapList<ComplexTerrainEntity> Room = RoomGenerator.Generate(_content);

            result.Put(Room, 3, 3);

            return result;
        }
Esempio n. 2
0
        /// <summary>
        /// 测试数组内容
        /// </summary>
        static void TestArrayMap()
        {
            //   使用前导入ArrayMap.DLL文件

            //简单使用
            MapList mapList = new MapList();

            mapList.Put("agv0001", false); //没锁定

            mapList.Put("agv0001", true);  //锁定

            //获取agv锁定情况
            Boolean isLock = mapList.GetBooleanValue("agv0001");


            MapList map = new MapList();

            //新增
            map.Put("001", true);
            map.Put("002", false);
            map.Put("003", "HELLO");

            MapList map2 = new MapList();

            //新增
            map2.Put("001", "yes");
            map2.Put("003", true);
            map2.Put("004", "NONONO");


            //替换
            map.Put("001", "HI");
            map2.Put("003", "OK");

            map.GetBooleanValue("001");

            Console.WriteLine(map.GetStringValue("002"));


            for (int i = 0; i < map.Length(); i++)
            {
                Map m  = map.GetMapAtIndex(i);
                Map m2 = map2.GetMapAtIndex(i);

                Console.WriteLine(m.Key + ": " + m.Value);
                Console.WriteLine(m2.Key + ": " + m2.Value);
            }
            Console.WriteLine(map.length);
            Console.WriteLine(map2.length);

            Console.ReadKey();
        }
Esempio n. 3
0
 private static int GetRate(string name)
 {
     value = map.GetStringValue(name);
     if (value != null && !value.Equals(""))
     {
         int rate = 0;
         try
         {
             rate = int.Parse(value) + 10;
         }
         catch
         {
         }
         map.Put(name, rate + "");
         return(rate);
     }
     map.Put(name, "0");
     return(0);
 }
Esempio n. 4
0
 public static void AgvLock(String agvid)
 {
     _mapList.Put(agvid, true);
 }