Example #1
0
        public void LoadTSCB(string path)
        {
            using (FileStream stream = new FileStream(path, FileMode.Open, FileAccess.Read))
            {
                EndianBinaryReader reader = new EndianBinaryReader(stream, Endian.Big);

                if (new string(reader.ReadChars(4)) != "TSCB")
                {
                    throw new FormatException("File was not TSCB!");
                }

                Trace.Assert(reader.ReadInt32() == 0x0A000000);
                Trace.Assert(reader.ReadInt32() == 1);

                m_stringTableOffset  = reader.ReadInt32();
                UnknownFloat1        = reader.ReadSingle();
                UnknownFloat2        = reader.ReadSingle();
                m_firstSectionCount  = reader.ReadInt32();
                m_secondSectionCount = reader.ReadInt32();

                FirstSectionData = new FirstSection();
                FirstSectionData.Load(reader, m_firstSectionCount);

                SecondSectionData = new SecondSection();
                SecondSectionData.Load(reader, m_secondSectionCount);
            }
        }
Example #2
0
        public void ShouldSumAllValuesOfSpecifiedType(int type, int v1, int v2, int v3, int v4, int v5, int expected)
        {
            var fakeDice = new Mock <Dice>();

            fakeDice.Setup(d => d.GetValues()).Returns(new List <int> {
                v1, v2, v3, v4, v5
            });

            var sut    = new FirstSection(type, fakeDice.Object);
            var actual = sut.GetValue();

            Assert.Equal(expected, actual);
        }
Example #3
0
 /// <summary>
 /// Convenience method returning the value of the numeric
 /// property with the specified ID. If the property is not
 /// available, 0 is returned. A subsequent call To {@link #WasNull}
 /// will return <c>true</c> To let the caller distinguish
 /// that case from a real property value of 0.
 /// </summary>
 /// <param name="id">The property ID</param>
 /// <returns>The propertyIntValue value</returns>
 public virtual int GetPropertyIntValue(int id)
 {
     return(FirstSection.GetPropertyIntValue(id));
 }
Example #4
0
 /// <summary>
 /// Convenience method returning the value of a bool property
 /// with the specified ID. If the property is not available,
 /// <c>false</c> is returned. A subsequent call To {@link
 /// #WasNull} will return <c>true</c> To let the caller
 /// distinguish that case from a real property value of
 /// <c>false</c>.
 /// </summary>
 /// <param name="id">The property ID</param>
 /// <returns>The property value</returns>
 public virtual bool GetPropertyBooleanValue(int id)
 {
     return(FirstSection.GetPropertyBooleanValue(id));
 }
Example #5
0
 /// <summary>
 /// Convenience method returning the value of the property with
 /// the specified ID. If the property is not available,
 /// <c>null</c> is returned and a subsequent call To {@link
 /// #WasNull} will return <c>true</c> .
 /// </summary>
 /// <param name="id">The property ID</param>
 /// <returns>The property value</returns>
 public virtual Object GetProperty(int id)
 {
     return(FirstSection.GetProperty(id));
 }
Example #6
0
 public void GetPageSections()
 {
     FirstSection.GetPageSections();
 }
Example #7
0
 public void SetPage(int pageNumber, int totalPages)
 {
     FirstSection.SetPage(pageNumber, totalPages);
 }