コード例 #1
0
ファイル: QuakeFile.cs プロジェクト: optimus-code/Q2Sharp
        public virtual SuperAdapter ReadAdapter( )
        {
            if (Input.ReadInt32() != 3988)
            {
                Com.DPrintf("wrong read position: readadapter 3988 \\n");
            }
            var id = ReadString();

            if (id == null)
            {
                return(null);
            }

            return(SuperAdapter.GetFromID(id));
        }
コード例 #2
0
ファイル: QuakeFile.cs プロジェクト: optimus-code/Quake2Sharp
        /** Reads the adapter id and returns the adapter. */
        public static SuperAdapter ReadAdapter(this BinaryReader binaryReader)
        {
            if (binaryReader.ReadInt32() != 3988)
            {
                Com.DPrintf("wrong read position: readadapter 3988 \n");
            }

            var id = binaryReader.ReadStringQ();

            if (id == null)
            {
                // null adapter. :-)
                return(null);
            }

            return(SuperAdapter.getFromID(id));
        }
コード例 #3
0
ファイル: QuakeFile.cs プロジェクト: optimus-code/Q2Sharp
        public virtual void WriteAdapter(SuperAdapter a)
        {
            Output.Write(3988);
            if (a == null)
            {
                Write(( String )null);
            }
            else
            {
                var str = a.GetID();
                if (a == null)
                {
                    Com.DPrintf("writeAdapter: invalid Adapter id for " + a + "\\n");
                }

                Write(str);
            }
        }
コード例 #4
0
ファイル: QuakeFile.cs プロジェクト: optimus-code/Quake2Sharp
        /** Writes the Adapter-ID to the file. */
        public static void Write(this BinaryWriter binaryWriter, SuperAdapter a)
        {
            binaryWriter.Write(3988);

            if (a == null)
            {
                binaryWriter.WriteQ(null);
            }
            else
            {
                var str = a.getID();

                if (a == null)
                {
                    Com.DPrintf("writeAdapter: invalid Adapter id for " + a + "\n");
                }

                binaryWriter.WriteQ(str);
            }
        }