示例#1
0
文件: fldmcf.cs 项目: ArtReeX/memoria
    public static DMSMapChar?ff9fieldMCFGetCharByID(DMSMapConf ObjPtr, Int32 model)
    {
        model &= 65535;
        if (ObjPtr.charUse == 0)
        {
            return(null);
        }
        DMSMapChar[] dmsmapChar = ObjPtr.DMSMapChar;
        Int32        num        = (Int32)(ObjPtr.charUse - 1);
        DMSMapChar   value;

        for (;;)
        {
            value = dmsmapChar[num];
            if (value.geoNo == (UInt16)model)
            {
                break;
            }
            num--;
            if (num < 0)
            {
                goto Block_3;
            }
        }
        return(new DMSMapChar?(value));

Block_3:
        return(null);
    }
示例#2
0
    public static DMSMapConf DMSParseMapConfFile(BinaryReader reader)
    {
        DMSMapConf result = default(DMSMapConf);

        result.attr       = reader.ReadUInt16();
        result.version    = reader.ReadUInt16();
        result.bgNo       = reader.ReadUInt16();
        result.lightCount = reader.ReadByte();
        result.lightUse   = reader.ReadByte();
        result.charCount  = reader.ReadByte();
        result.charUse    = reader.ReadByte();
        result.evtCount   = reader.ReadByte();
        result.evtUse     = reader.ReadByte();
        Int32 lightCount = (Int32)result.lightCount;

        result.DMSMapLight = new DMSMapLight[(Int32)result.lightCount];
        for (Int32 i = 0; i < lightCount; i++)
        {
            result.DMSMapLight[i].Read(reader);
        }
        Int32 charCount = (Int32)result.charCount;

        result.DMSMapChar = new DMSMapChar[(Int32)result.charCount];
        for (Int32 j = 0; j < charCount; j++)
        {
            result.DMSMapChar[j].Read(reader);
        }
        return(result);
    }
示例#3
0
    public static DMSMapConf?LoadMapConfigData(String fileName)
    {
        TextAsset textAsset = AssetManager.Load <TextAsset>("CommonAsset/MapConfigData/" + fileName, false);

        if (textAsset == (UnityEngine.Object)null)
        {
            return(null);
        }
        MemoryStream memoryStream = new MemoryStream(textAsset.bytes);
        BinaryReader binaryReader = new BinaryReader(memoryStream);
        DMSMapConf   value        = MapConfiguration.DMSParseMapConfFile(binaryReader);

        binaryReader.Close();
        memoryStream.Close();
        return(new DMSMapConf?(value));
    }
示例#4
0
文件: fldmcf.cs 项目: ArtReeX/memoria
    public static DMSMapLight?ff9fieldMCFGetLightByCharFloor(DMSMapConf ObjPtr, Int32 uid, ref Int16 FloorNoPtr)
    {
        Int16 num = 0;

        BGI.BGI_charGetInfo(uid, ref num, ref FloorNoPtr);
        if (ObjPtr.lightUse == 0)
        {
            return(null);
        }
        if ((FloorNoPtr & 255) == 255)
        {
            return(null);
        }
        DMSMapLight[] dmsmapLight = ObjPtr.DMSMapLight;
        Int32         num2        = (Int32)(ObjPtr.lightUse - 1);
        DMSMapLight   value;

        for (;;)
        {
            value = dmsmapLight[num2];
            if ((Int32)value.type == 0)
            {
                for (Int32 i = 3; i >= 0; i--)
                {
                    SByte b    = value.floor[i];
                    Int32 num3 = (Int32)b & 255;
                    if (num3 == (Int32)FloorNoPtr)
                    {
                        goto Block_4;
                    }
                }
            }
            num2--;
            if (num2 < 0)
            {
                goto Block_5;
            }
        }
Block_4:
        return(new DMSMapLight?(value));

Block_5:
        return(null);
    }
示例#5
0
文件: fldmcf.cs 项目: ArtReeX/memoria
    public static DMSMapLight[] ff9fieldMCFGetLightDefault(DMSMapConf ObjPtr, ref DMSMapLight?DefaultPtr, ref DMSMapLight?LadderPtr)
    {
        if (ObjPtr.lightUse == 0)
        {
            return(null);
        }
        DMSMapLight[] dmsmapLight = ObjPtr.DMSMapLight;
        Int32         num         = (Int32)(ObjPtr.lightUse - 1);

        do
        {
            DMSMapLight value = dmsmapLight[num];
            if ((Int32)value.type == 1)
            {
                DefaultPtr = new DMSMapLight?(value);
            }
            else if ((Int32)value.type == 2)
            {
                LadderPtr = new DMSMapLight?(value);
            }
            num--;
        }while (num >= 0);
        return(dmsmapLight);
    }
示例#6
0
    public static Int32 DMSGetMapConfMember(DMSMapConf ObjPtr, DMSMapConfMember ObjMember)
    {
        switch (ObjMember)
        {
        case DMSMapConfMember.DMS_MAPCONF_ATTR:
            return((Int32)ObjPtr.attr);

        case DMSMapConfMember.DMS_MAPCONF_VERSION:
            return((Int32)ObjPtr.version);

        case DMSMapConfMember.DMS_MAPCONF_BGNO:
            return((Int32)ObjPtr.bgNo);

        case DMSMapConfMember.DMS_MAPCONF_LIGHTCOUNT:
            return((Int32)ObjPtr.lightCount);

        case DMSMapConfMember.DMS_MAPCONF_LIGHTUSE:
            return((Int32)ObjPtr.lightUse);

        case DMSMapConfMember.DMS_MAPCONF_CHARCOUNT:
            return((Int32)ObjPtr.charCount);

        case DMSMapConfMember.DMS_MAPCONF_CHARUSE:
            return((Int32)ObjPtr.charUse);

        case DMSMapConfMember.DMS_MAPCONF_EVTCOUNT:
            return((Int32)ObjPtr.evtCount);

        case DMSMapConfMember.DMS_MAPCONF_EVTUSE:
            return((Int32)ObjPtr.evtUse);

        default:
            global::Debug.LogError(new ArgumentNullException("Null DMSMapConfMember"));
            return(-1);
        }
    }