Last change
on this file since 1149 was 1114, checked in by iritscen, 5 years ago |
Adding OniSplit source code (v0.9.99.0). Many thanks to Neo for all his work over the years.
|
File size:
704 bytes
|
Rev | Line | |
---|
[1114] | 1 | using System;
|
---|
| 2 |
|
---|
| 3 | namespace Oni.Game
|
---|
| 4 | {
|
---|
| 5 | internal class WeaponClass
|
---|
| 6 | {
|
---|
| 7 | private InstanceDescriptor geometry;
|
---|
| 8 |
|
---|
| 9 | public static WeaponClass Read(InstanceDescriptor descriptor)
|
---|
| 10 | {
|
---|
| 11 | if (descriptor.Template.Tag != TemplateTag.ONWC)
|
---|
| 12 | throw new ArgumentException(string.Format("The specified descriptor has a wrong template {0}", descriptor.Template.Tag), "descriptor");
|
---|
| 13 |
|
---|
| 14 | var weapon = new WeaponClass();
|
---|
| 15 |
|
---|
| 16 | using (var reader = descriptor.OpenRead(0x58))
|
---|
| 17 | weapon.geometry = reader.ReadInstance();
|
---|
| 18 |
|
---|
| 19 | return weapon;
|
---|
| 20 | }
|
---|
| 21 |
|
---|
| 22 | public InstanceDescriptor Geometry => geometry;
|
---|
| 23 | }
|
---|
| 24 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.