コード例 #1
0
ファイル: BGEO.cs プロジェクト: Cebtenzzre/XmodsDataLib
        public int section3count(int section1entryNumber, int lod)
        {
            Section1 sect1 = getSection1(section1entryNumber);

            int[] LODdata = sect1.LODdata(lod);
            return(LODdata[2]);
        }
コード例 #2
0
ファイル: NVA.cs プロジェクト: swordworld/dstools
        internal override void Read(BinaryReaderEx br)
        {
            br.BigEndian = false;
            br.AssertASCII("NVMA");
            Version = br.ReadEnum32 <NVAVersion>();
            br.ReadUInt32();                                             // File size
            br.AssertInt32(Version == NVAVersion.OldBloodborne ? 8 : 9); // Section count

            Navmeshes = new NavmeshSection(br);
            Entries1  = new Section1(br);
            Entries2  = new Section2(br);
            new Section3(br);
            Connectors = new ConnectorSection(br);
            var connectorPoints     = new ConnectorPointSection(br);
            var connectorConditions = new ConnectorConditionSection(br);

            Entries7 = new Section7(br);
            if (Version == NVAVersion.OldBloodborne)
            {
                Entries8 = new Section8(1);
            }
            else
            {
                Entries8 = new Section8(br);
            }

            foreach (Connector connector in Connectors)
            {
                connector.TakePointsAndConds(connectorPoints, connectorConditions);
            }
        }
コード例 #3
0
        public IHttpActionResult PutSection1(int id, Section1 section1)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != section1.Sections_id)
            {
                return(BadRequest());
            }

            db.Entry(section1).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!Section1Exists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
コード例 #4
0
ファイル: FXR3.cs プロジェクト: jakewestrip/RoguelikeSouls
 public FXR3()
 {
     Version      = FXRVersion.Sekiro;
     Section1Tree = new Section1();
     Section4Tree = new Section4();
     Section12s   = new List <int>();
     Section13s   = new List <int>();
 }
コード例 #5
0
ファイル: FXR3.cs プロジェクト: koriandrei/SoulsFormats
 public FXR3()
 {
     Version      = FXRVersion.DarkSouls3;
     Section1Tree = new Section1();
     Section4Tree = new Section4();
     Section12s   = new List <int>();
     Section13s   = new List <int>();
 }
コード例 #6
0
 /// <summary>
 /// Creates an empty NVA formatted for DS3.
 /// </summary>
 public NVA()
 {
     Version    = NVAVersion.DarkSouls3;
     Navmeshes  = new NavmeshSection(2);
     Entries1   = new Section1();
     Entries2   = new Section2();
     Connectors = new ConnectorSection();
     Entries7   = new Section7();
 }
コード例 #7
0
        public IActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }
            Section1 selectedSection = _context.Section1.FirstOrDefault(s => s.ID == id);

            return(View(selectedSection));
        }
コード例 #8
0
        public IHttpActionResult GetSection1(int id)
        {
            Section1 section1 = db.Sections1.Find(id);

            if (section1 == null)
            {
                return(NotFound());
            }

            return(Ok(section1));
        }
コード例 #9
0
        public IHttpActionResult PostSection1(Section1 section1)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.Sections1.Add(section1);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = section1.Sections_id }, section1));
        }
コード例 #10
0
ファイル: BGEO.cs プロジェクト: Cebtenzzre/XmodsDataLib
        public int section3count(int section1entryNumber)
        {
            Section1 sect1 = getSection1(section1entryNumber);
            int      tmp   = 0;

            for (int i = 0; i < this.sect1lodcount; i++)
            {
                int[] LODdata = sect1.LODdata(i);
                tmp += LODdata[2];
            }
            return(tmp);
        }
コード例 #11
0
        public IHttpActionResult DeleteSection1(int id)
        {
            Section1 section1 = db.Sections1.Find(id);

            if (section1 == null)
            {
                return(NotFound());
            }

            db.Sections1.Remove(section1);
            db.SaveChanges();

            return(Ok(section1));
        }
コード例 #12
0
        public override int GetHashCode()
        {
            unchecked
            {
                var hash = 12;

                hash = hash * 32 + Section0.GetHashCode();
                hash = hash * 32 + Section1.GetHashCode();
                hash = hash * 32 + Section2.GetHashCode();
                hash = hash * 32 + Section3.GetHashCode();
                hash = hash * 32 + Section4.GetHashCode();
                hash = hash * 32 + Section5.GetHashCode();
                hash = hash * 32 + Section6.GetHashCode();

                return(hash);
            }
        }
コード例 #13
0
        public IActionResult Edit(int?id, Section1 section, IFormFile Photo)
        {
            if (id == null)
            {
                return(NotFound());
            }
            //Image Upload
            string imgName    = Guid.NewGuid() + "_" + Photo.FileName;
            string uploadLink = Path.Combine(_env.WebRootPath, "uploads");
            string filePath   = Path.Combine(uploadLink, imgName);

            using FileStream file = new FileStream(filePath, FileMode.Create);
            Photo.CopyTo(file);
            section.PhotoUrl = imgName;
            _context.Section1.Update(section);
            _context.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #14
0
 public ActionResult <Section1> Load([FromBody] Section1 param)
 {
     if (param == null)
     {
         param          = new Section1();
         param._message = _localizer["No parameters."];
         return(BadRequest(param));
     }
     try
     {
         param.Item1 = (Guid.NewGuid()).ToString();
         return(Ok(param));
     }
     catch (Exception ex)
     {
         param._message = _localizer["System error Please inform system personnel.({0})", ex.Message];
         return(BadRequest(param));
     }
 }
コード例 #15
0
ファイル: Loader.xaml.cs プロジェクト: GooogleTHT/LGcl2
        private async void Start()
        {
            double margin = ActualHeight / 30;

            Section1.Margin = Section2.Margin = Section3.Margin = new Thickness(margin);

            var anim = new DoubleAnimation(ActualHeight / 2, ActualHeight - margin * 2, new Duration(TimeSpan.FromMilliseconds(AnimationTime)));

            anim.RepeatBehavior    = RepeatBehavior.Forever;
            anim.AutoReverse       = true;
            anim.AccelerationRatio = .85;

            Section1.Height = Section2.Height = Section3.Height = anim.From.Value;
            Section1.BeginAnimation(HeightProperty, anim);
            await Task.Delay(AnimationTime / 3);

            Section2.BeginAnimation(HeightProperty, anim);
            await Task.Delay(AnimationTime / 3);

            Section3.BeginAnimation(HeightProperty, anim);
        }
コード例 #16
0
ファイル: FXR3.cs プロジェクト: koriandrei/SoulsFormats
        protected override void Read(BinaryReaderEx br)
        {
            br.BigEndian = false;

            br.AssertASCII("FXR\0");
            br.AssertInt16(0);
            Version = br.ReadEnum16 <FXRVersion>();
            br.AssertInt32(1);
            ID = br.ReadInt32();
            int section1Offset = br.ReadInt32();

            br.AssertInt32(1); // Section 1 count
            br.ReadInt32();    // Section 2 offset
            br.ReadInt32();    // Section 2 count
            br.ReadInt32();    // Section 3 offset
            br.ReadInt32();    // Section 3 count
            int section4Offset = br.ReadInt32();

            br.ReadInt32(); // Section 4 count
            br.ReadInt32(); // Section 5 offset
            br.ReadInt32(); // Section 5 count
            br.ReadInt32(); // Section 6 offset
            br.ReadInt32(); // Section 6 count
            br.ReadInt32(); // Section 7 offset
            br.ReadInt32(); // Section 7 count
            br.ReadInt32(); // Section 8 offset
            br.ReadInt32(); // Section 8 count
            br.ReadInt32(); // Section 9 offset
            br.ReadInt32(); // Section 9 count
            br.ReadInt32(); // Section 10 offset
            br.ReadInt32(); // Section 10 count
            br.ReadInt32(); // Section 11 offset
            br.ReadInt32(); // Section 11 count
            br.AssertInt32(1);
            br.AssertInt32(0);

            if (Version == FXRVersion.Sekiro)
            {
                int section12Offset = br.ReadInt32();
                int section12Count  = br.ReadInt32();
                int section13Offset = br.ReadInt32();
                int section13Count  = br.ReadInt32();
                br.ReadInt32();    // Section 14 offset
                br.AssertInt32(0); // Section 14 count
                br.AssertInt32(0);
                br.AssertInt32(0);

                Section12s = new List <int>(br.GetInt32s(section12Offset, section12Count));
                Section13s = new List <int>(br.GetInt32s(section13Offset, section13Count));
            }
            else
            {
                Section12s = new List <int>();
                Section13s = new List <int>();
            }

            br.Position  = section1Offset;
            Section1Tree = new Section1(br);

            br.Position  = section4Offset;
            Section4Tree = new Section4(br);
        }
コード例 #17
0
 public HomeController(Section1 section1)
 {
     _section1 = section1;
 }
コード例 #18
0
ファイル: FXR3.cs プロジェクト: nexus4411/SoulsFormats
        internal override void Read(BinaryReaderEx br)
        {
            br.BigEndian = false;

            br.AssertASCII("FXR\0");
            br.AssertInt32(0x40000);
            br.AssertInt32(1);
            ID = br.ReadInt32();

            int section1Offset  = br.ReadInt32();
            int section1Count   = br.AssertInt32(1);
            int section2Offset  = br.ReadInt32();
            int section2Count   = br.ReadInt32();
            int section3Offset  = br.ReadInt32();
            int section3Count   = br.ReadInt32();
            int section4Offset  = br.ReadInt32();
            int section4Count   = br.ReadInt32();
            int section5Offset  = br.ReadInt32();
            int section5Count   = br.ReadInt32();
            int section6Offset  = br.ReadInt32();
            int section6Count   = br.ReadInt32();
            int section7Offset  = br.ReadInt32();
            int section7Count   = br.ReadInt32();
            int section8Offset  = br.ReadInt32();
            int section8Count   = br.ReadInt32();
            int section9Offset  = br.ReadInt32();
            int section9Count   = br.ReadInt32();
            int section10Offset = br.ReadInt32();
            int section10Count  = br.ReadInt32();
            int section11Offset = br.ReadInt32();
            int section11Count  = br.ReadInt32();

            br.AssertInt32(1);
            br.AssertInt32(0);

            br.Position  = section1Offset;
            Section1Tree = new Section1(br);

            br.Position = section2Offset;
            var section2s = new Dictionary <int, Section2>(section2Count);

            for (int i = 0; i < section2Count; i++)
            {
                section2s[(int)br.Position] = new Section2(br);
            }

            br.Position = section3Offset;
            var section3s = new Dictionary <int, Section3>(section3Count);

            for (int i = 0; i < section3Count; i++)
            {
                section3s[(int)br.Position] = new Section3(br);
            }

            br.Position = section4Offset;
            var section4s = new Dictionary <int, Section4>(section4Count);

            for (int i = 0; i < section4Count; i++)
            {
                section4s[(int)br.Position] = new Section4(br);
            }

            br.Position = section5Offset;
            var section5s = new Dictionary <int, Section5>(section5Count);

            for (int i = 0; i < section5Count; i++)
            {
                section5s[(int)br.Position] = new Section5(br);
            }

            br.Position = section6Offset;
            var section6s = new Dictionary <int, Section6>(section6Count);

            for (int i = 0; i < section6Count; i++)
            {
                section6s[(int)br.Position] = new Section6(br);
            }

            br.Position = section7Offset;
            var section7s = new Dictionary <int, Section7>(section7Count);

            for (int i = 0; i < section7Count; i++)
            {
                section7s[(int)br.Position] = new Section7(br);
            }

            br.Position = section8Offset;
            var section8s = new Dictionary <int, Section8>(section8Count);

            for (int i = 0; i < section8Count; i++)
            {
                section8s[(int)br.Position] = new Section8(br);
            }

            br.Position = section9Offset;
            var section9s = new Dictionary <int, Section9>(section9Count);

            for (int i = 0; i < section9Count; i++)
            {
                section9s[(int)br.Position] = new Section9(br);
            }

            br.Position = section10Offset;
            var section10s = new Dictionary <int, Section10>(section10Count);

            for (int i = 0; i < section10Count; i++)
            {
                section10s[(int)br.Position] = new Section10(br);
            }

            br.Position = section11Offset;
            var section11s = new Dictionary <int, int>(section11Count);

            for (int i = 0; i < section11Count; i++)
            {
                section11s[(int)br.Position] = br.ReadInt32();
            }

            var section2List  = new List <Section2>(section2s.Values);
            var section3List  = new List <Section3>(section3s.Values);
            var section4List  = new List <Section4>(section4s.Values);
            var section5List  = new List <Section5>(section5s.Values);
            var section6List  = new List <Section6>(section6s.Values);
            var section7List  = new List <Section7>(section7s.Values);
            var section8List  = new List <Section8>(section8s.Values);
            var section9List  = new List <Section9>(section9s.Values);
            var section10List = new List <Section10>(section10s.Values);

            Section1Tree.Take(section2s);

            foreach (Section2 section2 in section2List)
            {
                section2.Take(section3s);
            }

            foreach (Section3 section3 in section3List)
            {
                section3.Take(section11s);
            }

            foreach (Section4 section4 in section4List)
            {
                section4.Take(section4s, section5s, section6s);
            }

            foreach (Section5 section5 in section5List)
            {
                section5.Take(section6s);
            }

            foreach (Section6 section6 in section6List)
            {
                section6.Take(section7s, section10s, section11s);
            }

            foreach (Section7 section7 in section7List)
            {
                section7.Take(section8s, section11s);
            }

            foreach (Section8 section8 in section8List)
            {
                section8.Take(section9s, section11s);
            }

            foreach (Section9 section9 in section9List)
            {
                section9.Take(section11s);
            }

            foreach (Section10 section10 in section10List)
            {
                section10.Take(section11s);
            }

            if (section2s.Count != 0)
            {
                throw null;
            }

            if (section3s.Count != 0)
            {
                throw null;
            }

            if (section4s.Count != 1)
            {
                throw null;
            }

            if (section5s.Count != 0)
            {
                throw null;
            }

            if (section6s.Count != 0)
            {
                throw null;
            }

            if (section7s.Count != 0)
            {
                throw null;
            }

            if (section8s.Count != 0)
            {
                throw null;
            }

            if (section9s.Count != 0)
            {
                throw null;
            }

            if (section10s.Count != 0)
            {
                throw null;
            }

            if (section11s.Count != 0)
            {
                throw null;
            }

            Section4Tree = section4s.Values.First();
        }
コード例 #19
0
 public static Section1 CreateSection1(int ID, string sectionID, int maxEnrollment, int year, string season, string meetingDays, global::System.DateTime meetingTime, global::System.DateTime startDate, global::System.DateTime endDate, byte[] rowVersion, int section_Course, int section_Instructor)
 {
     Section1 section1 = new Section1();
     section1.Id = ID;
     section1.SectionID = sectionID;
     section1.MaxEnrollment = maxEnrollment;
     section1.Year = year;
     section1.Season = season;
     section1.MeetingDays = meetingDays;
     section1.MeetingTime = meetingTime;
     section1.StartDate = startDate;
     section1.EndDate = endDate;
     section1.RowVersion = rowVersion;
     section1.Section_Course = section_Course;
     section1.Section_Instructor = section_Instructor;
     return section1;
 }
コード例 #20
0
        public void Test()
        {
            if (File.Exists(Section1.XsdFile))
            {
                File.Delete(Section1.XsdFile);
            }

            Section1 a = (XmlConfiguration <Section1>)ConfigurationManager.GetSection("Section1");

            Assert.AreEqual(123, a.id);
            Assert.AreEqual(432.1, a.value);
            Assert.AreEqual("hello", a.name);
            a = null;

            Section2 b = ((XmlConfiguration <Section2>)ConfigurationManager.GetSection("Section2")).Settings;

            Assert.AreEqual(123, b.id);
            Assert.AreEqual("432.1", b.value);
            Assert.AreEqual("hello", b.name);
            b = null;

            b = XmlConfiguration <Section2> .ReadConfig("Section2");

            Assert.AreEqual(123, b.id);
            Assert.AreEqual("432.1", b.value);
            Assert.AreEqual("hello", b.name);
            b = null;

            using (XmlReader rdr = new XmlTextReader(new StringReader("<Section2 id='123' value='432.1'><name>hello</name></Section2>")))
            {
                b = XmlConfiguration <Section2> .ReadXml(rdr);

                Assert.AreEqual(123, b.id);
                Assert.AreEqual("432.1", b.value);
                Assert.AreEqual("hello", b.name);
                b = null;
            }

            XmlConfiguration <Section2> .XmlSchema = System.Xml.Schema.XmlSchema.Read(
                this.GetType().Assembly.GetManifestResourceStream(this.GetType().Namespace + ".TestXmlSection2.xsd"),
                null
                );

            //now we should get an exception when reading section 2...
            try
            {
                ConfigurationManager.RefreshSection("Section2");
                b = (XmlConfiguration <Section2>)ConfigurationManager.GetSection("Section2");
            }
            catch (System.Configuration.ConfigurationErrorsException ce)
            {
                Assert.IsTrue(ce.Message.Contains("The 'value' attribute is invalid"));
                Assert.IsNotNull(ce.InnerException);
                Assert.AreEqual(typeof(XmlException), ce.InnerException.GetType());
            }
            Assert.IsNull(b);

            Section3 c = (XmlConfiguration <Section3>)ConfigurationManager.GetSection("Section3");

            Assert.AreEqual(123, c.id);
            Assert.AreEqual(new DateTime(2009, 12, 25, 0, 0, 0), c.value);
            Assert.AreEqual("hello", c.name);
            b = null;

            // the following invalid xsd will cause an exception
            File.WriteAllText(Section1.XsdFile, "<xs:schema  xmlns:xs='http://www.w3.org/2001/XMLSchema'><xs:element /></xs:schema>");
            ConfigurationManager.RefreshSection("Section1");
            string origDir = Environment.CurrentDirectory;

            Environment.CurrentDirectory = Path.GetTempPath();
            try
            {
                a = (XmlConfiguration <Section1>)ConfigurationManager.GetSection("Section1");
            }
            catch (ConfigurationErrorsException) { }
            finally
            {
                Environment.CurrentDirectory = origDir;
                File.Delete(Section1.XsdFile);
            }
            Assert.IsNull(a);
        }
コード例 #21
0
 public void AddToSections(Section1 section1)
 {
     base.AddObject("Sections", section1);
 }