示例#1
0
        /// <summary>
        /// Lists out all coordinates of tiles present in <see cref="Layer2"/> that don't have anything underneath in <see cref="Layer1"/> to support them.
        /// </summary>
        /// <returns></returns>
        public List <string> GetUnsupportedTiles()
        {
            var result = new List <string>();

            for (int x = 0; x < FieldItemLayer.FieldItemWidth; x++)
            {
                for (int y = 0; y < FieldItemLayer.FieldItemHeight; y++)
                {
                    var tile = Layer2.GetTile(x, y);
                    if (tile.IsNone)
                    {
                        continue;
                    }

                    var support = Layer1.GetTile(x, y);
                    if (!support.IsNone)
                    {
                        continue; // dunno how to check if the tile can actually have an item put on top of it...
                    }
                    result.Add($"{x:000},{y:000}");
                }
            }
            return(result);
        }
示例#2
0
        private void SetTileActiveFlags(FieldItemLayer tiles, int ofs)
        {
            // Although the Tiles are arranged y-column (y-x) based, the 'isActive' flags are arranged x-row (x-y) based.
            // We can turn the isActive flag off if the item is not a root or the item cannot be animated.
            for (int x = 0; x < 224; x++)
            {
                for (int y = 0; y < 192; y++)
                {
                    var tile     = tiles.GetTile(x, y);
                    var isActive = IsActive(ofs, x, y);
                    if (!isActive)
                    {
                        continue;
                    }

                    bool empty = tile.IsNone;
                    if (empty)
                    {
                        Debug.WriteLine($"Flag at ({x},{y}) is not a root object.");
                    }
                }
            }
        }
示例#3
0
 public bool IsOccupied(int x, int y) => !Layer1.GetTile(x, y).IsNone || !Layer2.GetTile(x, y).IsNone;