本文整理汇总了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);
}
示例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"));
}
}
示例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;
}
示例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;
}
示例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.
}
}
示例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() );
}
}
示例7: Draw
public void Draw(Map map)
{
Console.Clear();
Console.WriteLine(map.ToString());
Console.WriteLine(string.Format("Generation:{0}", map.Generation));
}
示例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()));
}
示例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);
}
示例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 ) );
}