コード例 #1
0
ファイル: LogicTile.cs プロジェクト: NotHuza/Cerberus-v4
        /// <summary>
        ///     Refreshes sub tiles.
        /// </summary>
        public void RefreshSubTiles()
        {
            this._passableFlag &= 0xF0;

            for (int i = 0; i < this._gameObjects.Count; i++)
            {
                LogicGameObject gameObject = this._gameObjects[i];

                this._pathFinderCost = LogicMath.Max(this._pathFinderCost, gameObject.GetPathFinderCost());

                if (!gameObject.IsPassable())
                {
                    int width = gameObject.GetWidthInTiles();

                    if (width == 1)
                    {
                        this._passableFlag |= 0xF0;
                    }
                    else
                    {
                        int tileX  = gameObject.GetTileX();
                        int tileY  = gameObject.GetTileY();
                        int edge   = gameObject.PassableSubtilesAtEdge();
                        int startX = 2 * width - edge;
                        int startY = 2 * width - edge;
                        int endX   = 2 * (width - edge);
                        int endY   = 2 * (width - edge);

                        // RIP

                        /* do
                         * {
                         *     v11 = v20 + v19;
                         *     v12 = -1;
                         *     v13 = v20;
                         *     do
                         *     {
                         *         v14 = 2 * (v28 - v27) + v12 + 1;
                         *         v16 = __OFSUB__(v14, v9);
                         *         v15 = v14 - v9 < 0;
                         *         if ( v14 < v9 )
                         *         {
                         *             v16 = __OFSUB__(v11, v10);
                         *             v15 = v11 - v10 < 0;
                         *         }
                         *         if ( v15 ^ v16 )
                         *         {
                         *             v18 = __OFSUB__(v11, v8);
                         *             v17 = v11 - v8 < 0;
                         *             if ( v11 >= v8 )
                         *             {
                         *                 v18 = __OFSUB__(v14, v8);
                         *                 v17 = v14 - v8 < 0;
                         *             }
                         *              if ( !(v17 ^ v18) )
                         *(_BYTE *)(v1 + 8) |= 1 << v13;
                         *          }
                         ++v12;
                         *          v13 += 2;
                         *     }
                         *     while ( v12 < 1 );
                         *     v19 = v29;
                         *     v16 = __OFSUB__(v20, 1);
                         *     v15 = v20++ - 1 < 0;
                         * }
                         * while ( v15 ^ v16 );
                         */
                    }
                }
            }
        }