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


C# Tile.ToString方法代码示例

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


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

示例1: AddTile

        public void AddTile(int downsample, Tile tile)
        {
            SortedDictionary<string, Tile> tiles;

            if (TilesAtLevel.ContainsKey(downsample) == false)
            {
                tiles = new SortedDictionary<string, Tile>();
                tiles.Add(tile.ToString(), tile);
                TilesAtLevel.Add(downsample, tiles);
            }
            else
            {
                tiles = TilesAtLevel[downsample];
                Debug.Assert(false == tiles.ContainsKey(tile.ToString()));
                tiles.Add(tile.ToString(), tile);
            }
        }
开发者ID:abordt,项目名称:Viking,代码行数:17,代码来源:TilePyramid.cs

示例2: AddAndSpawnKebabBuilding

    public void AddAndSpawnKebabBuilding(KebabBuilding building, Tile tile)
    {
        StopCoroutine("CustomerSpawnerRutine");

        if (tile.type == TileType.Buildable)
            Destroy(GameObject.Find(tile.ToString()));

        world.AddBuilding(building, tile);
        SpawnBuilding(building);
        StartCoroutine(world.SetNewCustomerDestinations(tile.x, tile.z));

        StartCoroutine("CustomerSpawnerRutine");
    }
开发者ID:bjorntore,项目名称:KebabOslo,代码行数:13,代码来源:WorldController.cs

示例3: TileToChar

 private static char TileToChar(Tile tile)
 {
     switch (tile)
     {
         case Tile.Empty:
             return ' ';
         case Tile.Floor:
             return '.';
         case Tile.Wall:
             return '#';
         default:
             throw new KeyNotFoundException(tile.ToString());
     }
 }
开发者ID:ilezhnin,项目名称:DungeonSharp,代码行数:14,代码来源:Renderer.cs

示例4: SaveElement

 public static bool SaveElement(UIElement element, Tile tile)
 {
     try
     {
         var side = (tile == Tile.Small) ? 159 : 336;
         element.Measure(new Size(side, side));
         element.Arrange(new Rect(0, 0, side, side));
         var bmp = new WriteableBitmap(side, side);
         bmp.Render(element, null);
         bmp.Invalidate();
         var name = tile.ToString() + Guid.NewGuid() + ".png";
         using (var isf = IsolatedStorageFile.GetUserStoreForApplication())
         {
             if (!isf.DirectoryExists("/CustomLiveTiles"))
             {
                 isf.CreateDirectory("/CustomLiveTiles");
             }
             using (var myFileStream = isf.CreateFile("shared/shellcontent/" + name))
             {
                 // Encode WriteableBitmap object to a PNG stream.
                 bmp.WritePng(myFileStream);
             }
             var filesTodelete =
                      from f in isf.GetFileNames("shared/shellcontent/" + tile + "*").AsQueryable()
                      where !f.EndsWith(name)
                      select f;
             foreach (var file in filesTodelete)
             {
                 isf.DeleteFile("shared/shellcontent/" + file);
             }
         }
         SaveTilePart("isostore:/Shared/ShellContent/" + name, tile);
     }
     catch (Exception)
     {
         Thread.Sleep(1000);
         if (tile == Tile.Small)
         {
             SaveTilePart(GetDefaultSmallTile(), tile);
         }
         else
         {
             SaveTilePart((tile == Tile.Front) ? GetDefaultFrontTile() : GetDefaultBackTile(), tile);
         }
         return false;
     }
     return true;
 }
开发者ID:JanJoris,项目名称:VikingApp,代码行数:48,代码来源:Helper.cs

示例5: Main

        static void Main(string[] args)
        {
            byte[] rom = File.ReadAllBytes(ROM_PATH);

            List<Tile> tiles = new List<Tile>();
            using (StreamWriter outfile = new StreamWriter(VECTOR_FILE_PATH))
                for (int level = 0; level < LEVELS.Length; level++)
                {
                    Tile t = null;
                    for (int i = LEVELS[level]; (t == null) || (!t.End); i += 2)
                    {
                        byte rom_0 = rom[i];
                        byte rom_1 = rom[i + 1];

                        t = new Tile(rom_0, rom_1);
                        string word = t.ToWord();
                        outfile.WriteLine(word);

                        Tile recreated = new Tile(word);

                        if (t.ToString() != recreated.ToString())
                        {
                            throw new Exception("Recreated tile failed to match!");
                        }

                        ushort recreatedBytes = recreated.ToBytes();
                        byte byte0 = (byte)((recreatedBytes & 0xFF00) >> 8);
                        byte byte1 = (byte)(recreatedBytes & 0xFF);

                        if (rom_0 != byte0)
                        {
                            //throw new Exception("Recreated bytes failed to match!");
                            Debugger.Break();
                        }
                        if (!recreated.End &&
                            rom_1 != byte1)
                        {
                            //throw new Exception("Recreated bytes failed to match!");
                            Debugger.Break();
                        }

                        tiles.Add(t);
                    }

                }
        }
开发者ID:terrabite3,项目名称:Level-Extraction,代码行数:46,代码来源:LevelExtractor.cs

示例6: CompareSimilarPatterns

        public void CompareSimilarPatterns()
        {
            // Setup
            int bitsPerColour = 8;
            int tileSize = 16;
            int offsetX = 0;
            int offsetY = 0;

            //Bitmap croppedImage = Program.LoadImage(@"C:\Users\nicB\Documents\tileTest.png");
            Program.LoadImage(@"C:\Users\nicB\Documents\tileTest.png", tileSize, offsetX, offsetY);

            //int x = 0;
            //int y = 0;
            int index = 0;

            //Bitmap image1 = Program.GetTileImage(x, y, TileSize);
            Bitmap image1 = Program.GetTileImage(index);
            Tile tile1 = new Tile(image1, bitsPerColour, tileSize, index);
            Console.WriteLine("Tile 1: " + tile1.ToString());

            //x = 16;
            index = 1;
            //Bitmap image2 = Program.GetTileImage(x, y, TileSize);
            Bitmap image2 = Program.GetTileImage(index);
            Tile tile2 = new Tile(image2, bitsPerColour, tileSize, 1);
            Console.WriteLine("Tile 2: " + tile2.ToString());

            // Execution
            Tuple<float, float> results = tile1.GetMatches(tile2);
            float patternMatch = results.Item1;
            float colourMatch = results.Item2;

            bool identical = tile1.IdenticalTo(tile2);

            // Assertion
            float expectedPatternMatch = 223 / 255f;
            Assert.IsTrue(patternMatch == expectedPatternMatch, string.Format("Expected {0}, Actual {1}", expectedPatternMatch, patternMatch));

            Assert.IsFalse(identical);
        }
开发者ID:Blkx-Darkreaper,项目名称:Workspace,代码行数:40,代码来源:UnitTests.cs

示例7: AddBuilding

 public void AddBuilding(Building building, Tile tile)
 {
     if (tile.type == TileType.Buildable)
     {
         buildings.Add(building);
         building.tile = tile;
         building.tile.type = TileType.Occupied;
         if (building is KebabBuilding)
         {
             _kebabBuildings.Add((KebabBuilding)building);
             SanityCheckKebabBuildingsCount();
         }
     }
     else
         throw new Exception("Tried to add a new building to tile " + tile.ToString() + " when not allowed. Should not happend. Fix originating code.");
 }
开发者ID:bjorntore,项目名称:KebabOslo,代码行数:16,代码来源:World.cs

示例8: RemoveInteractable

    /**
     * Remove the interactable on the given tile from the list of tiles
     *
     * Arguments
     * - Tile toRemove - The tile that contains an interactable object
     */
    public void RemoveInteractable(Tile toRemove)
    {
        int index = GetInteractable(toRemove); // The index of the interactive object in the list

        if (index == -1) {
            Debug.Log("Can't find Tile");
            return;
        }
        blockedTiles.Remove(toRemove);
        InteractiveTiles.Remove(InteractiveTiles[index]);
        Debug.Log("int Remove: " + toRemove.ToString());
        Object.FindObjectOfType<GameManager>().OpenDoor(toRemove);
    }
开发者ID:RandomTroll18,项目名称:deco3801-nodayoff,代码行数:19,代码来源:MovementController.cs

示例9: Reach

 public void Reach(Tile tile)
 {
     client.Send("<REACH hai=\"" + tile.ToString() + "\" />");
     GameData.player[0].reached = true;
 }
开发者ID:key8931,项目名称:Tenhou-Client,代码行数:5,代码来源:TenhouClient.cs

示例10: ToStringTest

 public void ToStringTest()
 {
     Tile target = new Tile(); // TODO: Initialize to an appropriate value
     string expected = string.Empty; // TODO: Initialize to an appropriate value
     string actual;
     actual = target.ToString();
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
开发者ID:holtkampw,项目名称:UH-Sample-XNA-Project,代码行数:9,代码来源:TileTest.cs

示例11: StartMe

    /**
     * Overload for intializing this interactive object.
     *
     * Arguments
     * - GameManager g - The game manager script
     */
    public void StartMe(GameManager g)
    {
        if (DebugOption)
            Debug.Log("Started");

        // Initialize variables
        position = new Tile(
            Tile.TilePosition(transform.position.x),
            Tile.TilePosition(transform.position.z)
        ); // Interactive object position tile
        IsInactivated = false;  // Interactive object activated value
        MinCost = Cost; // Interactive object cost value
        panel = GameObject.FindGameObjectWithTag("SkillPanel"); // Reference to skill panel
        nameLabel = panel.transform.FindChild("SkillCheckText").GetComponent<Text>(); // Skill panel text
        APSlider = panel.transform.FindChild("Slider").GetComponent<Slider>(); // Skill panel slider
        MController = g.GetPlayerControllers(); // Game movenment controller
        //player = GameObject.Find ("Player"); // Player gameobject
        PrimaryO = GameObject.FindGameObjectWithTag ("Objective UI")
            .GetComponent<PrimaryObjectiveController>(); // Primary Objective script
        player = Player.MyPlayer; // Player gameobject
        PlayerScript = player.GetComponent<Player>(); // Player script
        MController.AddInteractable(this); // Add interactable to Movement controller

        if (DebugOption)
            Debug.Log(position.ToString());
    }
开发者ID:RandomTroll18,项目名称:deco3801-nodayoff,代码行数:32,代码来源:InteractiveObject.cs


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