当前位置: 首页>>代码示例>>C#>>正文


C# Map.ToString方法代码示例

本文整理汇总了C#中Map.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Map.ToString方法的具体用法?C# Map.ToString怎么用?C# Map.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Map的用法示例。


在下文中一共展示了Map.ToString方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Map_Renders_MapDiv_With_Default_Options

        public void Map_Renders_MapDiv_With_Default_Options()
        {
            var map = new Map();

            var html = map.ToString();

            Assert.That(html, Is.Not.Null);
        }
开发者ID:subgurim,项目名称:subgurim-maps-core,代码行数:8,代码来源:MapTests.cs

示例2: LoadMap

 void LoadMap()
 {
     UnloadCurrentMap();
     TiledMap = new Map(Maps[CurrentMap], true, MapsPath, this.gameObject);
     Debug.Log(TiledMap.ToString());
     MapObjectLayer mol = TiledMap.GetLayer("PropertyTest") as MapObjectLayer;
     if (mol != null)
     {
         Debug.Log(mol.GetPropertyAsBoolean("test"));
     }
 }
开发者ID:networkpadawan,项目名称:X-uniTMX2D,代码行数:11,代码来源:MapLoader.cs

示例3: LoadMap

 void LoadMap()
 {
     UnloadCurrentMap();
     TiledMap = new Map(Maps[CurrentMap], true, MapsPath, this.gameObject, defaultMaterial, sortingOrder);
     TiledMap.GenerateCollidersFromLayer("Collider_0");
     TiledMap.GenerateCollidersFromLayer("Colliders");
     Debug.Log(TiledMap.ToString());
     MapObjectLayer mol = TiledMap.GetLayer("PropertyTest") as MapObjectLayer;
     if (mol != null)
     {
         Debug.Log(mol.GetPropertyAsBoolean("test"));
     }
     // Center camera
     _camera.CamPos = new Vector3(TiledMap.Width / 2.0f, -TiledMap.Height / 2.0f, _camera.CamPos.z);
     _camera.PixelsPerUnit = TiledMap.TileHeight;
 }
开发者ID:JeremyMah,项目名称:ProjectChessStone,代码行数:16,代码来源:MapLoader.cs

示例4: OnMapLoaded

 void OnMapLoaded(Map map)
 {
     TiledMap = map;
     if (TiledMap.GetObjectLayer("Collider_0") != null)
         TiledMap.GenerateCollidersFromLayer("Collider_0");
     if (TiledMap.GetObjectLayer("Colliders") != null)
         TiledMap.GenerateCollidersFromLayer("Colliders");
     Debug.Log(TiledMap.ToString());
     MapObjectLayer mol = TiledMap.GetObjectLayer("PropertyTest");
     if (mol != null)
     {
         Debug.Log(mol.GetPropertyAsBoolean("test"));
     }
     // Center camera
     _camera.CamPos = TiledMap.TiledPositionToWorldPoint(TiledMap.Width / 2.0f, TiledMap.Height / 2.0f, _camera.CamPos.z);
     _camera.PixelsPerUnit = TiledMap.TileHeight;
 }
开发者ID:urgamedev,项目名称:UnityFighter2D,代码行数:17,代码来源:MapLoader.cs

示例5: Main

    static void Main(string[] args)
    {
        string[] inputs;
        List<Point> _lst_point = new List<Point>();
        int surfaceN = int.Parse(Console.ReadLine()); // the number of points used to draw the surface of Mars.
        for (int i = 0; i < surfaceN; i++)
        {
            inputs = Console.ReadLine().Split(' ');
            _lst_point.Add(new Point(int.Parse(inputs[0]), int.Parse(inputs[1])));
        }
        
        map = new Map(_lst_point);
        Console.Error.WriteLine(map.ToString());

        // game loop
        while (true)
        {
            inputs = Console.ReadLine().Split(' ');
            Point shuttle = new Point(int.Parse(inputs[0]), int.Parse(inputs[1]));
            int hSpeed = int.Parse(inputs[2]); // the horizontal speed (in m/s), can be negative.
            int vSpeed = int.Parse(inputs[3]); // the vertical speed (in m/s), can be negative.
            int fuel = int.Parse(inputs[4]); // the quantity of remaining fuel in liters.
            int rotate = int.Parse(inputs[5]); // the rotation angle in degrees (-90 to 90).
            int power = int.Parse(inputs[6]); // the thrust power (0 to 4).

            // Write an action using Console.WriteLine()
            // To debug: Console.Error.WriteLine("Debug messages...");
            double best_angle = Math.Round(OnTravel(shuttle, map._flat, hSpeed, vSpeed));
            decreaseHSpeed = Math.Abs(hSpeed) > MAX_H_SPEED; 
            decreaseVSpeed = Math.Abs(vSpeed) > MAX_V_SPEED;
            power = 4;
            
            if(map._flat.Y + HEIGHT_SECURITY > shuttle.Y)
                best_angle = 0;
            if(map._flat.LandingCondition(shuttle))
            {
                best_angle = Math.Round(GetLandingAngle(hSpeed, vSpeed, shuttle, map._flat));
                if(!decreaseVSpeed & !decreaseHSpeed)
                    power = 2;
            }
            Console.WriteLine(best_angle+" "+power); // rotate power. rotate is the desired rotation angle. power is the desired thrust power.
        }
    }
开发者ID:quentinlebot,项目名称:CDGChallenges,代码行数:43,代码来源:MarsLanderLvl2MEDIUM.cs

示例6: QuestArea

        public QuestArea( TextDefinition name, string region, Map forceMap )
        {
            m_Name = name;
            m_RegionName = region;
            m_ForceMap = forceMap;

            if ( MLQuestSystem.Debug )
            {
                bool found = false;

                foreach ( Region r in Region.Regions )
                {
                    if ( r.Name == region && ( forceMap == null || r.Map == forceMap ) )
                    {
                        found = true;
                        break;
                    }
                }

                if ( !found )
                    Console.WriteLine( "Warning: QuestArea region '{0}' does not exist (ForceMap = {1})", region, ( forceMap == null ) ? "-null-" : forceMap.ToString() );
            }
        }
开发者ID:OurUO,项目名称:ouruo-server,代码行数:23,代码来源:QuestArea.cs

示例7: Draw

 public void Draw(Map map)
 {
     Console.Clear();
     Console.WriteLine(map.ToString());
     Console.WriteLine(string.Format("Generation:{0}", map.Generation));
 }
开发者ID:sousousore1,项目名称:LifeGame,代码行数:6,代码来源:Draw.cs

示例8: SaveXDoc

 private static void SaveXDoc(Map mapName)
 {
     if(!Directory.Exists(@"C:\Maps\"))
     {
         Directory.CreateDirectory(@"C:\Maps\");
     }
     xDoc.Save(string.Format(@"C:\Maps\{0}.svg", mapName.ToString()));
 }
开发者ID:R3MUSDevPack,项目名称:ReconnectedServerStuff,代码行数:8,代码来源:Program.cs

示例9: GetIntelMap

        //
        // GET: /Intel/
        public ActionResult GetIntelMap(Map map)
        {
            var vm = new IntelViewModel() { Title = map.ToString(), Map = string.Concat("/maps/", map.ToString(), ".svg") };
            //var vm = new IntelViewModel() { Title = map.ToString(), Map = string.Concat("/maps/Immensea_noJB.svg") };

            return View(vm);
        }
开发者ID:R3MUSDevPack,项目名称:ReconnectedServerStuff,代码行数:9,代码来源:IntelController.cs

示例10: Restore_AfterComputingFovAndSaving_ExpectedMapWithFov

        public void Restore_AfterComputingFovAndSaving_ExpectedMapWithFov()
        {
            string mapRepresentation = @"####################################
                                      #..................................#
                                      #..###.########....................#
                                      #....#.#......#....................#
                                      #....#.#......#....................#
                                      #.............#....................#
                                      #....#.#......######################
                                      #....#.#...........................#
                                      #....#.#...........................#
                                      #..................................#
                                      ####################################";
             IMapCreationStrategy<Map> mapCreationStrategy = new StringDeserializeMapCreationStrategy<Map>( mapRepresentation );
             IMap map = Map.Create( mapCreationStrategy );
             map.ComputeFov( 6, 1, 20, true );
             map.AppendFov( 15, 1, 5, true );
             MapState mapState = map.Save();

             IMap newMap = new Map();
             newMap.Restore( mapState );

             string expectedFovMap = @"###########################%%%%%%%%%
                                   #..........................%%%%%%%%%
                                   #..###.########...........%%%%%%%%%%
                                   #%%%%#.#%%%%%%#....%%%%%%%%%%%%%%%%%
                                   %%%%%#.#%%%%%%#...%%%%%%%%%%%%%%%%%%
                                   %%%%%%.%%%%%%%#..%%%%%%%%%%%%%%%%%%%
                                   %%%%%#.#%%%%%%####%%%%%%%%%%%%%%%%%%
                                   %%%%%#.#%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                                   %%%%%#.#%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                                   %%%%%%.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                                   %%%%%###%%%%%%%%%%%%%%%%%%%%%%%%%%%%";
             Assert.AreEqual( expectedFovMap.Replace( " ", string.Empty ), newMap.ToString( true ) );
        }
开发者ID:hybrid1969,项目名称:RogueSharp,代码行数:35,代码来源:MapTest.cs


注:本文中的Map.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。