LynnaLab.WarpSourceData.GetNextWarp C# (CSharp) Method

GetNextWarp() public method

public GetNextWarp ( ) : WarpSourceData
return WarpSourceData
        public WarpSourceData GetNextWarp()
        {
            if (WarpSourceType != WarpSourceType.PointedWarp) return null;

            // A warp with opcode bit 7 set signals the end of the sequence
            if ((Opcode & 0x80) != 0) return null;

            FileComponent next = Next;
            while (next != null) {
                // This condition is a bit weird, but the game doesn't always
                // end with a 0x80 opcode, so I need another way to discern the
                // endpoint
                if (next is Label) return null;

                if (next is Data) return next as WarpSourceData;

                next = next.Next;
            }

            return null;
        }

Usage Example

コード例 #1
0
        public bool SetNextWarp(WarpSourceData next)
        {
            if (!FileParser.InsertComponentAfter(this, next))
            {
                return(false);
            }

            this.Opcode &= ~0x80;
            if (next.GetNextWarp() == null)
            {
                next.Opcode |= 0x80;
            }
            else
            {
                next.Opcode &= 0x80;
            }
            return(true);
        }
All Usage Examples Of LynnaLab.WarpSourceData::GetNextWarp