diff --git a/.github/ISSUE_TEMPLATE/release-candidate.yml b/.github/ISSUE_TEMPLATE/release-candidate.yml
index e341535..1969879 100644
--- a/.github/ISSUE_TEMPLATE/release-candidate.yml
+++ b/.github/ISSUE_TEMPLATE/release-candidate.yml
@@ -1,5 +1,5 @@
name: Release candidate feedback
-description: Report OpenDisNet 0.9 RC interoperability, API, performance, or documentation results.
+description: Report OpenDisNet prerelease interoperability, API, performance, or documentation results.
title: "[RC feedback]: "
body:
- type: markdown
@@ -10,8 +10,8 @@ body:
id: version
attributes:
label: Package version
- description: Enter the exact prerelease version, for example 0.9.0-rc.1.
- placeholder: 0.9.0-rc.1
+ description: Enter the exact prerelease version, for example 1.1.0-rc.1.
+ placeholder: 1.1.0-rc.1
validations:
required: true
- type: input
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index df94f60..682406e 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -47,4 +47,4 @@ jobs:
with:
dotnet-version: 10.x
- run: dotnet restore --locked-mode
- - run: dotnet format --verify-no-changes --no-restore --exclude tests/OpenDisNet.Reference
+ - run: dotnet format --verify-no-changes --no-restore
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 13aa585..c593e4e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,10 +1,22 @@
# Changelog
All notable changes are documented here. This project follows Semantic
-Versioning after 1.0 and uses prerelease versions while conformance is incomplete.
+Versioning starting with 1.0 and uses prerelease versions when conformance is
+incomplete.
## Unreleased
+## 1.0.1 - 2026-07-13
+
+- Updated local package defaults and the binary-compatibility baseline for the
+ stable 1.x line.
+- Replaced completed prerelease language with durable stable-release guidance.
+- Corrected public XML documentation inherited from the generator schemas.
+- Removed the unused generated C# reference project while retaining the compact,
+ independently produced conformance-vector corpus.
+
+## 1.0.0 - 2026-07-13
+
- Added the 1.0 conformance audit manifest and report, pinning DIS schemas, SISO
data, independent vector corpora, family mappings, and the public API by
SHA-256.
@@ -14,6 +26,9 @@ Versioning after 1.0 and uses prerelease versions while conformance is incomplet
enforced low-or-higher transitive NuGet vulnerability auditing.
- Added pull-request dependency review, main-branch tag verification, package
checksums, and GitHub build-provenance attestations.
+
+## 0.9.0 - 2026-07-13
+
- Froze the complete public C# surface with compiler-enforced API baselines and
NuGet package compatibility validation against OpenDisNet 0.8.0.
- Added an external-style smoke consumer that installs the packed artifact and
@@ -22,6 +37,9 @@ Versioning after 1.0 and uses prerelease versions while conformance is incomplet
structured GitHub feedback form.
- Corrected the `RadioId` construction example discovered by the package smoke
consumer.
+
+## 0.8.0 - 2026-07-13
+
- Added deterministic populated conformance cases for all 72 DIS v7 PDU types,
independent byte vectors, and truncation checks at every byte boundary across
all 12 protocol families planned for versions 0.3 through 0.8.
@@ -30,6 +48,9 @@ Versioning after 1.0 and uses prerelease versions while conformance is incomplet
lengths and counts.
- Added conditional IFF information layers and polymorphic Information
Operations effect/communications records to the native C# codec.
+
+## 0.2.0 - 2026-07-13
+
- Added strongly typed SISO-REF-010-2025 v36 enumerations for every DIS v7
schema reference, with .NET-style public names.
- Added structured bitfield value types with validated accessors, immutable
@@ -40,6 +61,14 @@ Versioning after 1.0 and uses prerelease versions while conformance is incomplet
lossless unknown-value compatibility tests.
- Made descriptive PDU names such as `AcknowledgeReliablePdu` canonical and
removed 20 empty acronym-based alias shells from the public model surface.
+
+## 0.1.1 - 2026-07-13
+
+- Replaced hand-authored Signal PDU payload bytes in documentation with
+ realistic application-produced audio examples.
+
+## 0.1.0 - 2026-07-13
+
- Added solution foundation, DIS v7 framing, binary primitives, and defensive
unknown-PDU parsing.
- Added typed Entity State, Fire, and Detonation PDU parsing and serialization.
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 59583fd..8974c05 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -5,7 +5,7 @@ vectors, round-trip tests, and malformed-input tests. Run `dotnet test
--configuration Release` before opening a pull request. Do not submit IEEE
specification text or non-public operational packet captures.
-The public API is frozen during the 0.9 release-candidate cycle. Additive API
-changes must update `src/OpenDisNet/PublicAPI.Unshipped.txt`, include tests, and
-describe the consumer benefit in the changelog. Removals or signature changes
-require explicit breaking-change review and a new release candidate.
+The 1.x public API follows semantic versioning. Additive API changes must update
+`src/OpenDisNet/PublicAPI.Unshipped.txt`, include tests, and describe the
+consumer benefit in the changelog. Removals or incompatible signature changes
+require explicit breaking-change review and belong in the next major release.
diff --git a/OpenDisNet.slnx b/OpenDisNet.slnx
index 751cfd7..ff35901 100644
--- a/OpenDisNet.slnx
+++ b/OpenDisNet.slnx
@@ -6,7 +6,6 @@
-
diff --git a/README.md b/README.md
index 2bb498a..107524a 100644
--- a/README.md
+++ b/README.md
@@ -7,10 +7,11 @@
OpenDisNet is a high-performance, type-safe .NET codec for Distributed
Interactive Simulation (DIS) Protocol Version 7, defined by IEEE 1278.1-2012.
-> **Development status:** 1.0 release audit. All 72 DIS v7 PDU identifiers have
+> **Development status:** Stable 1.x release. All 72 DIS v7 PDU identifiers have
> typed native C# codecs, every family has populated, independent, malformed,
> and hostile-input evidence, and the public API is compatibility-frozen. See
-> the [`1.0 audit`](docs/conformance-audit-v1.0.md) and
+> the [`1.0 audit`](docs/conformance-audit-v1.0.md),
+> [`1.0.1 maintenance note`](docs/conformance-maintenance-v1.0.1.md), and
> [`conformance matrix`](docs/conformance.md).
## Install
diff --git a/THIRD-PARTY-NOTICES.md b/THIRD-PARTY-NOTICES.md
index 59a8b3b..3492249 100644
--- a/THIRD-PARTY-NOTICES.md
+++ b/THIRD-PARTY-NOTICES.md
@@ -6,8 +6,6 @@ OpenDisNet's implementation was independently designed with reference to:
- SISO-REF-010-2025, *Reference for Enumerations for Simulation Interoperability*.
- The `open-dis/opendis7-java` and `open-dis/opendis7-source-generator` projects,
distributed under the 3-Clause BSD License by their respective authors.
-- The `open-dis/open-dis-csharp` project, distributed under the 2-Clause BSD
- License by Open DIS and its contributors.
IEEE and SISO specification names are used only to identify interoperability
targets. No endorsement is implied. Specification text is not redistributed.
diff --git a/docs/api-design.md b/docs/api-design.md
index f0949b1..c84512a 100644
--- a/docs/api-design.md
+++ b/docs/api-design.md
@@ -38,13 +38,13 @@ untrusted network input.
## Compatibility
-The 0.9 release-candidate line freezes the complete public C# surface before
-1.0. `PublicAPI.Shipped.txt` is the reviewable contract. Compiler analyzers
-reject an unrecorded public addition or removal, and NuGet package validation
-compares 1.0 artifacts with version 0.9.0 for binary compatibility.
+Version 1.0 freezes the complete public C# surface. `PublicAPI.Shipped.txt` is
+the reviewable contract. Compiler analyzers reject an unrecorded public addition
+or removal, and NuGet package validation compares 1.x artifacts with version
+1.0.0 for binary compatibility.
New API belongs in `PublicAPI.Unshipped.txt` and requires tests plus a changelog
entry. Removing or changing frozen API requires explicit breaking-change review
-and another release candidate. After 1.0, public names and wire behavior follow
-semantic versioning. Internal codec generation may change without becoming part
-of the supported API.
+and a new major version. Public names and wire behavior follow semantic
+versioning. Internal codec generation may change without becoming part of the
+supported API.
diff --git a/docs/conformance-maintenance-v1.0.1.md b/docs/conformance-maintenance-v1.0.1.md
new file mode 100644
index 0000000..1a08898
--- /dev/null
+++ b/docs/conformance-maintenance-v1.0.1.md
@@ -0,0 +1,20 @@
+# OpenDisNet 1.0.1 conformance maintenance
+
+Version 1.0.1 does not change the supported DIS wire model, SISO enumeration
+baseline, public API, or conformance-vector corpus audited for version 1.0.
+
+The maintenance manifest `tests/OpenDisNet.Tests/Conformance/Audit/v1.0.1.json`
+retains the complete 1.0 inventory and updates two schema hashes solely because
+their human-readable comments were corrected. Generated public XML documentation
+changed, but no field name, type, width, ordering, condition, padding, factory
+mapping, parser behavior, or serialized byte changed.
+
+The test-only generated C# reference project and its single Fire PDU consumer
+were removed. The frozen independent corpus remains: 70 compatible default
+vectors and 44 compatible populated vectors span all 12 protocol families, with
+documented differential exceptions retained. Native populated, truncation, and
+hostile-input coverage for all 72 PDU types is unchanged.
+
+The original `v1.0.json` manifest and
+[`1.0 audit report`](conformance-audit-v1.0.md) remain unchanged as historical
+release evidence.
diff --git a/docs/conformance.md b/docs/conformance.md
index 4808f16..9280e07 100644
--- a/docs/conformance.md
+++ b/docs/conformance.md
@@ -23,7 +23,7 @@ input tests, and round-trip tests.
- [x] SISO-REF-010-2025 v36 typed enumerations and structured bitfields
- [x] Lossless round trip of unknown enumeration values and reserved bitfield bits
-## PDU families
+## Historical family delivery milestones
- [x] 0.3 Entity Information/Interaction
- [x] 0.3 Warfare
@@ -38,7 +38,7 @@ input tests, and round-trip tests.
- [x] 0.8 Live Entity
- [x] 0.8 Information Operations
-## 0.9 release readiness
+## Historical 0.9 release-readiness milestone
- [x] Frozen, compiler-enforced public C# API baseline
- [x] NuGet package compatibility validation against 0.8.0
@@ -47,7 +47,7 @@ input tests, and round-trip tests.
- [x] External RC validation checklist and structured feedback form
- [x] External RC feedback channel reviewed; no high-impact finding remains open
-## 1.0 release gates
+## Completed 1.0 release gates
- [x] SHA-256-pinned conformance audit manifest and published audit report
- [x] Every PDU type and protocol family accounted for exactly once
@@ -64,8 +64,10 @@ code or a runtime/build dependency. Two default vectors and 28 aggressively
populated vectors expose documented defects in that reference generator and are
retained as differential evidence rather than copied into OpenDisNet behavior.
-This file is a release gate. Version 1.0 will not be labeled complete until all
-applicable entries are checked and the reviewable project audit is complete.
+This file records the release gates completed for version 1.0. Future releases
+must retain the applicable checks and document any changed conformance scope.
The completed scope, evidence, limitations, and differential exceptions are in
-the [1.0 conformance audit](conformance-audit-v1.0.md).
+the [1.0 conformance audit](conformance-audit-v1.0.md). The documentation-only
+schema corrections and test-harness cleanup in 1.0.1 are recorded in the
+[1.0.1 maintenance note](conformance-maintenance-v1.0.1.md).
diff --git a/docs/release-candidate.md b/docs/release-candidate.md
index d8b96f5..400400e 100644
--- a/docs/release-candidate.md
+++ b/docs/release-candidate.md
@@ -1,17 +1,17 @@
-# 0.9 external release candidate
+# External release candidates
-Version 0.9 is the public API freeze and external validation stage before 1.0.
-The current C# surface is recorded in `PublicAPI.Shipped.txt`; builds reject an
-undocumented addition or removal, and package validation compares every new
-artifact with the published 0.8.0 package.
+Release candidates provide an external validation stage before a stable minor
+or major release. The current C# surface is recorded in
+`PublicAPI.Shipped.txt`; builds reject an undocumented addition or removal, and
+package validation compares every new artifact with the stable 1.0.0 baseline.
## Install an RC
-Release candidates use SemVer tags such as `v0.9.0-rc.1`. After a candidate is
+Release candidates use SemVer tags such as `v1.1.0-rc.1`. After a candidate is
published, install that exact version so test results remain reproducible:
```shell
-dotnet add package OpenDisNet --version 0.9.0-rc.1
+dotnet add package OpenDisNet --version 1.1.0-rc.1
```
GitHub and NuGet identify RC builds as prereleases. Do not use an RC in a
@@ -42,9 +42,9 @@ exact package version, target framework, operating system, PDU families tested,
and whether the problem concerns API usability, wire interoperability,
performance, or documentation.
-## 1.0 exit criteria
+## Stable-release exit criteria
-- Public API analyzer and 0.8.0 package-compatibility validation remain clean.
+- Public API analyzer and stable-baseline package-compatibility validation remain clean.
- The packed-package consumer passes on .NET 9 and .NET 10.
- No unresolved high-impact wire-correctness or data-loss defect remains.
- External testing covers real application workflows without relying on
diff --git a/docs/releasing.md b/docs/releasing.md
index e448ceb..d18c1ca 100644
--- a/docs/releasing.md
+++ b/docs/releasing.md
@@ -1,14 +1,14 @@
# Releasing
Releases are immutable and tag-driven. The `release.yml` workflow tests, packs,
-publishes to NuGet.org, and creates a GitHub release for tags such as `v0.2.0`.
+publishes to NuGet.org, and creates a GitHub release for tags such as `v1.0.1`.
GitHub-generated notes are categorized using `.github/release.yml`, and package
plus symbol artifacts are attached to the release shown on the repository page.
-Prerelease tags use SemVer identifiers such as `v0.9.0-rc.1`. The workflow
+Prerelease tags use SemVer identifiers such as `v1.1.0-rc.1`. The workflow
derives the package version from the tag and marks the GitHub release as a
prerelease automatically. Before publishing any tag, the workflow validates the
-public API, compares the package with the 0.9.0 compatibility baseline, and runs
+public API, compares the package with the 1.0.0 compatibility baseline, and runs
an external-style consumer against the packed artifact on .NET 9 and .NET 10.
The RC testing contract and feedback process are documented in
@@ -16,7 +16,7 @@ The RC testing contract and feedback process are documented in
only after its exit criteria are satisfied; published NuGet versions and GitHub
releases are never rewritten.
-## 1.0 security gates
+## Release security gates
A release tag must identify a commit contained in `main`. The release workflow
then repeats locked restore with low-or-higher transitive NuGet vulnerability
@@ -28,10 +28,10 @@ immutable GitHub release.
Verify a downloaded package with GitHub CLI:
```shell
-gh attestation verify OpenDisNet.1.0.0.nupkg --repo RejectKid/OpenDisNet
+gh attestation verify OpenDisNet.1.0.1.nupkg --repo RejectKid/OpenDisNet
```
-The 1.0 tag is permitted only when the
+Stable tags are permitted only when their applicable
[conformance audit](conformance-audit-v1.0.md) and all checks in the
[conformance matrix](conformance.md) are complete.
diff --git a/docs/standards.md b/docs/standards.md
index b47b9ba..5534fc1 100644
--- a/docs/standards.md
+++ b/docs/standards.md
@@ -19,10 +19,10 @@ cross-checks:
- `open-dis/opendis7-java`
- `open-dis/opendis7-source-generator`
-- `open-dis/open-dis-csharp`
The Java source generator reports 72 DIS v7 PDUs and provides machine-readable
-layout descriptions. It is an offline reference only: OpenDisNet is a native
-C#/.NET design with no Java code, dependency, or runtime requirement. Its
-conformance claim is based on its own coverage matrix and tests, not merely the
-presence of a corresponding reference class.
+layout descriptions and supplied the frozen independent byte-vector corpus. It
+is an offline reference only: OpenDisNet is a native C#/.NET design with no Java
+code, dependency, or runtime requirement. Its conformance claim is based on its
+own coverage matrix and tests, not merely the presence of a corresponding
+reference class.
diff --git a/src/OpenDisNet/OpenDisNet.csproj b/src/OpenDisNet/OpenDisNet.csproj
index 545d570..2b69402 100644
--- a/src/OpenDisNet/OpenDisNet.csproj
+++ b/src/OpenDisNet/OpenDisNet.csproj
@@ -4,7 +4,7 @@
OpenDisNet
OpenDisNet
OpenDisNet
- 0.1.0
+ 1.0.1
RejectKid
High-performance, type-safe DIS Protocol Version 7 binary codec for .NET.
DIS;IEEE-1278;simulation;PDU;protocol
@@ -18,7 +18,7 @@
$(NoWarn);CS1591
false
true
- 0.9.0
+ 1.0.0
true
diff --git a/src/OpenDisNet/Pdus/Families/DistributedEmissionsPdus.cs b/src/OpenDisNet/Pdus/Families/DistributedEmissionsPdus.cs
index c909645..f21b610 100644
--- a/src/OpenDisNet/Pdus/Families/DistributedEmissionsPdus.cs
+++ b/src/OpenDisNet/Pdus/Families/DistributedEmissionsPdus.cs
@@ -442,7 +442,7 @@ public partial class IdentificationFriendOrFoePdu : DistributedEmissionsRegenera
public EntityId EmittingEntityId { get; set; } = new EntityId();
///
- /// Number generated by the issuing simulation to associate realted events. Part of Layer 1 basic system data 7.6.5.2.
+ /// Number generated by the issuing simulation to associate related events. Part of Layer 1 basic system data 7.6.5.2.
///
public EventIdentifier EventId { get; set; } = new EventIdentifier();
@@ -795,7 +795,7 @@ public partial class UAEmitter
public ushort Padding { get; set; }
///
- /// TODO
+ /// Identifies the acoustic emitter represented by this system.
///
public AcousticEmitter AcousticEmitter { get; set; } = new AcousticEmitter();
diff --git a/src/OpenDisNet/Pdus/Families/Records.cs b/src/OpenDisNet/Pdus/Families/Records.cs
index 1da9b27..48d48c0 100644
--- a/src/OpenDisNet/Pdus/Families/Records.cs
+++ b/src/OpenDisNet/Pdus/Families/Records.cs
@@ -450,7 +450,7 @@ public partial class BeamData
public float BeamElevationSweep { get; set; }
///
- /// allows receiver to synchronize its regenerated scan pattern to that of the emmitter. Specifies the percentage of time a scan is through its pattern from its origion.
+ /// Allows a receiver to synchronize its regenerated scan pattern to that of the emitter. Specifies the percentage of time a scan has progressed through its pattern from its origin.
///
public float BeamSweepSync { get; set; }
diff --git a/tests/OpenDisNet.PackageSmoke/OpenDisNet.PackageSmoke.csproj b/tests/OpenDisNet.PackageSmoke/OpenDisNet.PackageSmoke.csproj
index 1df7f4c..7d41c64 100644
--- a/tests/OpenDisNet.PackageSmoke/OpenDisNet.PackageSmoke.csproj
+++ b/tests/OpenDisNet.PackageSmoke/OpenDisNet.PackageSmoke.csproj
@@ -5,7 +5,7 @@
false
net9.0;net10.0
- 0.1.0
+ 1.0.0
true
diff --git a/tests/OpenDisNet.Reference/Generated/AcknowledgePdu.cs b/tests/OpenDisNet.Reference/Generated/AcknowledgePdu.cs
deleted file mode 100644
index 7897ac4..0000000
--- a/tests/OpenDisNet.Reference/Generated/AcknowledgePdu.cs
+++ /dev/null
@@ -1,414 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Section 7.5.6. Acknowledge the receipt of a start/resume, stop/freeze, or RemoveEntityPDU. COMPLETE
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(EntityID))]
- public partial class AcknowledgePdu : SimulationManagementFamilyPdu, IEquatable
- {
- ///
- /// Identifier for originating entity(or simulation)
- ///
- private EntityID _originatingID = new EntityID();
-
- ///
- /// Identifier for the receiving entity(or simulation)
- ///
- private EntityID _receivingID = new EntityID();
-
- ///
- /// type of message being acknowledged
- ///
- private ushort _acknowledgeFlag;
-
- ///
- /// Whether or not the receiving entity was able to comply with the request
- ///
- private ushort _responseFlag;
-
- ///
- /// Request ID that is unique
- ///
- private uint _requestID;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public AcknowledgePdu()
- {
- PduType = (byte)15;
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(AcknowledgePdu left, AcknowledgePdu right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(AcknowledgePdu left, AcknowledgePdu right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public override int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize = base.GetMarshalledSize();
- marshalSize += this._originatingID.GetMarshalledSize(); // this._originatingID
- marshalSize += this._receivingID.GetMarshalledSize(); // this._receivingID
- marshalSize += 2; // this._acknowledgeFlag
- marshalSize += 2; // this._responseFlag
- marshalSize += 4; // this._requestID
- return marshalSize;
- }
-
- ///
- /// Gets or sets the Identifier for originating entity(or simulation)
- ///
- [XmlElement(Type = typeof(EntityID), ElementName = "originatingID")]
- public EntityID OriginatingID
- {
- get
- {
- return this._originatingID;
- }
-
- set
- {
- this._originatingID = value;
- }
- }
-
- ///
- /// Gets or sets the Identifier for the receiving entity(or simulation)
- ///
- [XmlElement(Type = typeof(EntityID), ElementName = "receivingID")]
- public EntityID ReceivingID
- {
- get
- {
- return this._receivingID;
- }
-
- set
- {
- this._receivingID = value;
- }
- }
-
- ///
- /// Gets or sets the type of message being acknowledged
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "acknowledgeFlag")]
- public ushort AcknowledgeFlag
- {
- get
- {
- return this._acknowledgeFlag;
- }
-
- set
- {
- this._acknowledgeFlag = value;
- }
- }
-
- ///
- /// Gets or sets the Whether or not the receiving entity was able to comply with the request
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "responseFlag")]
- public ushort ResponseFlag
- {
- get
- {
- return this._responseFlag;
- }
-
- set
- {
- this._responseFlag = value;
- }
- }
-
- ///
- /// Gets or sets the Request ID that is unique
- ///
- [XmlElement(Type = typeof(uint), ElementName = "requestID")]
- public uint RequestID
- {
- get
- {
- return this._requestID;
- }
-
- set
- {
- this._requestID = value;
- }
- }
-
- ///
- /// Automatically sets the length of the marshalled data, then calls the marshal method.
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- public override void MarshalAutoLengthSet(DataOutputStream dos)
- {
- // Set the length prior to marshalling data
- this.Length = (ushort)this.GetMarshalledSize();
- this.Marshal(dos);
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Marshal(DataOutputStream dos)
- {
- base.Marshal(dos);
- if (dos != null)
- {
- try
- {
- this._originatingID.Marshal(dos);
- this._receivingID.Marshal(dos);
- dos.WriteUnsignedShort((ushort)this._acknowledgeFlag);
- dos.WriteUnsignedShort((ushort)this._responseFlag);
- dos.WriteUnsignedInt((uint)this._requestID);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Unmarshal(DataInputStream dis)
- {
- base.Unmarshal(dis);
-
- if (dis != null)
- {
- try
- {
- this._originatingID.Unmarshal(dis);
- this._receivingID.Unmarshal(dis);
- this._acknowledgeFlag = dis.ReadUnsignedShort();
- this._responseFlag = dis.ReadUnsignedShort();
- this._requestID = dis.ReadUnsignedInt();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- base.Reflection(sb);
- try
- {
- sb.AppendLine("");
- this._originatingID.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- this._receivingID.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._acknowledgeFlag.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._responseFlag.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._requestID.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as AcknowledgePdu;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(AcknowledgePdu obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- ivarsEqual = base.Equals(obj);
-
- if (!this._originatingID.Equals(obj._originatingID))
- {
- ivarsEqual = false;
- }
-
- if (!this._receivingID.Equals(obj._receivingID))
- {
- ivarsEqual = false;
- }
-
- if (this._acknowledgeFlag != obj._acknowledgeFlag)
- {
- ivarsEqual = false;
- }
-
- if (this._responseFlag != obj._responseFlag)
- {
- ivarsEqual = false;
- }
-
- if (this._requestID != obj._requestID)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ base.GetHashCode();
-
- result = GenerateHash(result) ^ this._originatingID.GetHashCode();
- result = GenerateHash(result) ^ this._receivingID.GetHashCode();
- result = GenerateHash(result) ^ this._acknowledgeFlag.GetHashCode();
- result = GenerateHash(result) ^ this._responseFlag.GetHashCode();
- result = GenerateHash(result) ^ this._requestID.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/AcknowledgeReliablePdu.cs b/tests/OpenDisNet.Reference/Generated/AcknowledgeReliablePdu.cs
deleted file mode 100644
index 515cd4d..0000000
--- a/tests/OpenDisNet.Reference/Generated/AcknowledgeReliablePdu.cs
+++ /dev/null
@@ -1,345 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Section 5.3.12.5: Ack receipt of a start-resume, stop-freeze, create-entity or remove enitty (reliable) pdus. COMPLETE
- ///
- [Serializable]
- [XmlRoot]
- public partial class AcknowledgeReliablePdu : SimulationManagementWithReliabilityFamilyPdu, IEquatable
- {
- ///
- /// ack flags
- ///
- private ushort _acknowledgeFlag;
-
- ///
- /// response flags
- ///
- private ushort _responseFlag;
-
- ///
- /// Request ID
- ///
- private uint _requestID;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public AcknowledgeReliablePdu()
- {
- PduType = (byte)55;
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(AcknowledgeReliablePdu left, AcknowledgeReliablePdu right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(AcknowledgeReliablePdu left, AcknowledgeReliablePdu right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public override int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize = base.GetMarshalledSize();
- marshalSize += 2; // this._acknowledgeFlag
- marshalSize += 2; // this._responseFlag
- marshalSize += 4; // this._requestID
- return marshalSize;
- }
-
- ///
- /// Gets or sets the ack flags
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "acknowledgeFlag")]
- public ushort AcknowledgeFlag
- {
- get
- {
- return this._acknowledgeFlag;
- }
-
- set
- {
- this._acknowledgeFlag = value;
- }
- }
-
- ///
- /// Gets or sets the response flags
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "responseFlag")]
- public ushort ResponseFlag
- {
- get
- {
- return this._responseFlag;
- }
-
- set
- {
- this._responseFlag = value;
- }
- }
-
- ///
- /// Gets or sets the Request ID
- ///
- [XmlElement(Type = typeof(uint), ElementName = "requestID")]
- public uint RequestID
- {
- get
- {
- return this._requestID;
- }
-
- set
- {
- this._requestID = value;
- }
- }
-
- ///
- /// Automatically sets the length of the marshalled data, then calls the marshal method.
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- public override void MarshalAutoLengthSet(DataOutputStream dos)
- {
- // Set the length prior to marshalling data
- this.Length = (ushort)this.GetMarshalledSize();
- this.Marshal(dos);
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Marshal(DataOutputStream dos)
- {
- base.Marshal(dos);
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedShort((ushort)this._acknowledgeFlag);
- dos.WriteUnsignedShort((ushort)this._responseFlag);
- dos.WriteUnsignedInt((uint)this._requestID);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Unmarshal(DataInputStream dis)
- {
- base.Unmarshal(dis);
-
- if (dis != null)
- {
- try
- {
- this._acknowledgeFlag = dis.ReadUnsignedShort();
- this._responseFlag = dis.ReadUnsignedShort();
- this._requestID = dis.ReadUnsignedInt();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- base.Reflection(sb);
- try
- {
- sb.AppendLine("" + this._acknowledgeFlag.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._responseFlag.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._requestID.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as AcknowledgeReliablePdu;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(AcknowledgeReliablePdu obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- ivarsEqual = base.Equals(obj);
-
- if (this._acknowledgeFlag != obj._acknowledgeFlag)
- {
- ivarsEqual = false;
- }
-
- if (this._responseFlag != obj._responseFlag)
- {
- ivarsEqual = false;
- }
-
- if (this._requestID != obj._requestID)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ base.GetHashCode();
-
- result = GenerateHash(result) ^ this._acknowledgeFlag.GetHashCode();
- result = GenerateHash(result) ^ this._responseFlag.GetHashCode();
- result = GenerateHash(result) ^ this._requestID.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/AcousticEmitter.cs b/tests/OpenDisNet.Reference/Generated/AcousticEmitter.cs
deleted file mode 100644
index ea7d371..0000000
--- a/tests/OpenDisNet.Reference/Generated/AcousticEmitter.cs
+++ /dev/null
@@ -1,341 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// information about a specific UA emmtter. Section 6.2.2.
- ///
- [Serializable]
- [XmlRoot]
- public partial class AcousticEmitter
- {
- ///
- /// the system for a particular UA emitter, and an enumeration
- ///
- private ushort _acousticName;
-
- ///
- /// The function of the acoustic system
- ///
- private byte _function;
-
- ///
- /// The UA emitter identification number relative to a specific system
- ///
- private byte _acousticIdNumber;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public AcousticEmitter()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(AcousticEmitter left, AcousticEmitter right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(AcousticEmitter left, AcousticEmitter right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += 2; // this._acousticName
- marshalSize += 1; // this._function
- marshalSize += 1; // this._acousticIdNumber
- return marshalSize;
- }
-
- ///
- /// Gets or sets the the system for a particular UA emitter, and an enumeration
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "acousticName")]
- public ushort AcousticName
- {
- get
- {
- return this._acousticName;
- }
-
- set
- {
- this._acousticName = value;
- }
- }
-
- ///
- /// Gets or sets the The function of the acoustic system
- ///
- [XmlElement(Type = typeof(byte), ElementName = "function")]
- public byte Function
- {
- get
- {
- return this._function;
- }
-
- set
- {
- this._function = value;
- }
- }
-
- ///
- /// Gets or sets the The UA emitter identification number relative to a specific system
- ///
- [XmlElement(Type = typeof(byte), ElementName = "acousticIdNumber")]
- public byte AcousticIdNumber
- {
- get
- {
- return this._acousticIdNumber;
- }
-
- set
- {
- this._acousticIdNumber = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedShort((ushort)this._acousticName);
- dos.WriteUnsignedByte((byte)this._function);
- dos.WriteUnsignedByte((byte)this._acousticIdNumber);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._acousticName = dis.ReadUnsignedShort();
- this._function = dis.ReadUnsignedByte();
- this._acousticIdNumber = dis.ReadUnsignedByte();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("" + this._acousticName.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._function.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._acousticIdNumber.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as AcousticEmitter;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(AcousticEmitter obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (this._acousticName != obj._acousticName)
- {
- ivarsEqual = false;
- }
-
- if (this._function != obj._function)
- {
- ivarsEqual = false;
- }
-
- if (this._acousticIdNumber != obj._acousticIdNumber)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._acousticName.GetHashCode();
- result = GenerateHash(result) ^ this._function.GetHashCode();
- result = GenerateHash(result) ^ this._acousticIdNumber.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/ActionRequestPdu.cs b/tests/OpenDisNet.Reference/Generated/ActionRequestPdu.cs
deleted file mode 100644
index 4622583..0000000
--- a/tests/OpenDisNet.Reference/Generated/ActionRequestPdu.cs
+++ /dev/null
@@ -1,588 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Section 7.5.7. Request from simulation manager to a managed entity to perform a specified action. COMPLETE
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(EntityID))]
- [XmlInclude(typeof(FixedDatum))]
- [XmlInclude(typeof(VariableDatum))]
- public partial class ActionRequestPdu : SimulationManagementFamilyPdu, IEquatable
- {
- ///
- /// Identifier for originating entity(or simulation)
- ///
- private EntityID _originatingID = new EntityID();
-
- ///
- /// Identifier for the receiving entity(or simulation)
- ///
- private EntityID _receivingID = new EntityID();
-
- ///
- /// identifies the request being made by the simulaton manager
- ///
- private uint _requestID;
-
- ///
- /// identifies the particular action being requested(see Section 7 of SISO-REF-010).
- ///
- private uint _actionID;
-
- ///
- /// Number of fixed datum records
- ///
- private uint _numberOfFixedDatumRecords;
-
- ///
- /// Number of variable datum records
- ///
- private uint _numberOfVariableDatumRecords;
-
- ///
- /// variable length list of fixed datums
- ///
- private List _fixedDatums = new List();
-
- ///
- /// variable length list of variable length datums
- ///
- private List _variableDatums = new List();
-
- ///
- /// Initializes a new instance of the class.
- ///
- public ActionRequestPdu()
- {
- PduType = (byte)16;
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(ActionRequestPdu left, ActionRequestPdu right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(ActionRequestPdu left, ActionRequestPdu right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public override int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize = base.GetMarshalledSize();
- marshalSize += this._originatingID.GetMarshalledSize(); // this._originatingID
- marshalSize += this._receivingID.GetMarshalledSize(); // this._receivingID
- marshalSize += 4; // this._requestID
- marshalSize += 4; // this._actionID
- marshalSize += 4; // this._numberOfFixedDatumRecords
- marshalSize += 4; // this._numberOfVariableDatumRecords
- for (int idx = 0; idx < this._fixedDatums.Count; idx++)
- {
- FixedDatum listElement = (FixedDatum)this._fixedDatums[idx];
- marshalSize += listElement.GetMarshalledSize();
- }
-
- for (int idx = 0; idx < this._variableDatums.Count; idx++)
- {
- VariableDatum listElement = (VariableDatum)this._variableDatums[idx];
- marshalSize += listElement.GetMarshalledSize();
- }
-
- return marshalSize;
- }
-
- ///
- /// Gets or sets the Identifier for originating entity(or simulation)
- ///
- [XmlElement(Type = typeof(EntityID), ElementName = "originatingID")]
- public EntityID OriginatingID
- {
- get
- {
- return this._originatingID;
- }
-
- set
- {
- this._originatingID = value;
- }
- }
-
- ///
- /// Gets or sets the Identifier for the receiving entity(or simulation)
- ///
- [XmlElement(Type = typeof(EntityID), ElementName = "receivingID")]
- public EntityID ReceivingID
- {
- get
- {
- return this._receivingID;
- }
-
- set
- {
- this._receivingID = value;
- }
- }
-
- ///
- /// Gets or sets the identifies the request being made by the simulaton manager
- ///
- [XmlElement(Type = typeof(uint), ElementName = "requestID")]
- public uint RequestID
- {
- get
- {
- return this._requestID;
- }
-
- set
- {
- this._requestID = value;
- }
- }
-
- ///
- /// Gets or sets the identifies the particular action being requested(see Section 7 of SISO-REF-010).
- ///
- [XmlElement(Type = typeof(uint), ElementName = "actionID")]
- public uint ActionID
- {
- get
- {
- return this._actionID;
- }
-
- set
- {
- this._actionID = value;
- }
- }
-
- ///
- /// Note that setting this value will not change the marshalled value. The list whose length this describes is used for that purpose.
- /// The getnumberOfFixedDatumRecords method will also be based on the actual list length rather than this value.
- /// The method is simply here for completeness and should not be used for any computations.
- ///
- [XmlElement(Type = typeof(uint), ElementName = "numberOfFixedDatumRecords")]
- public uint NumberOfFixedDatumRecords
- {
- get
- {
- return this._numberOfFixedDatumRecords;
- }
-
- set
- {
- this._numberOfFixedDatumRecords = value;
- }
- }
-
- ///
- /// Note that setting this value will not change the marshalled value. The list whose length this describes is used for that purpose.
- /// The getnumberOfVariableDatumRecords method will also be based on the actual list length rather than this value.
- /// The method is simply here for completeness and should not be used for any computations.
- ///
- [XmlElement(Type = typeof(uint), ElementName = "numberOfVariableDatumRecords")]
- public uint NumberOfVariableDatumRecords
- {
- get
- {
- return this._numberOfVariableDatumRecords;
- }
-
- set
- {
- this._numberOfVariableDatumRecords = value;
- }
- }
-
- ///
- /// Gets or sets the variable length list of fixed datums
- ///
- [XmlElement(ElementName = "fixedDatumsList", Type = typeof(List))]
- public List FixedDatums
- {
- get
- {
- return this._fixedDatums;
- }
- }
-
- ///
- /// Gets or sets the variable length list of variable length datums
- ///
- [XmlElement(ElementName = "variableDatumsList", Type = typeof(List))]
- public List VariableDatums
- {
- get
- {
- return this._variableDatums;
- }
- }
-
- ///
- /// Automatically sets the length of the marshalled data, then calls the marshal method.
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- public override void MarshalAutoLengthSet(DataOutputStream dos)
- {
- // Set the length prior to marshalling data
- this.Length = (ushort)this.GetMarshalledSize();
- this.Marshal(dos);
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Marshal(DataOutputStream dos)
- {
- base.Marshal(dos);
- if (dos != null)
- {
- try
- {
- this._originatingID.Marshal(dos);
- this._receivingID.Marshal(dos);
- dos.WriteUnsignedInt((uint)this._requestID);
- dos.WriteUnsignedInt((uint)this._actionID);
- dos.WriteUnsignedInt((uint)this._fixedDatums.Count);
- dos.WriteUnsignedInt((uint)this._variableDatums.Count);
-
- for (int idx = 0; idx < this._fixedDatums.Count; idx++)
- {
- FixedDatum aFixedDatum = (FixedDatum)this._fixedDatums[idx];
- aFixedDatum.Marshal(dos);
- }
-
- for (int idx = 0; idx < this._variableDatums.Count; idx++)
- {
- VariableDatum aVariableDatum = (VariableDatum)this._variableDatums[idx];
- aVariableDatum.Marshal(dos);
- }
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Unmarshal(DataInputStream dis)
- {
- base.Unmarshal(dis);
-
- if (dis != null)
- {
- try
- {
- this._originatingID.Unmarshal(dis);
- this._receivingID.Unmarshal(dis);
- this._requestID = dis.ReadUnsignedInt();
- this._actionID = dis.ReadUnsignedInt();
- this._numberOfFixedDatumRecords = dis.ReadUnsignedInt();
- this._numberOfVariableDatumRecords = dis.ReadUnsignedInt();
- for (int idx = 0; idx < this.NumberOfFixedDatumRecords; idx++)
- {
- FixedDatum anX = new FixedDatum();
- anX.Unmarshal(dis);
- this._fixedDatums.Add(anX);
- };
-
- for (int idx = 0; idx < this.NumberOfVariableDatumRecords; idx++)
- {
- VariableDatum anX = new VariableDatum();
- anX.Unmarshal(dis);
- this._variableDatums.Add(anX);
- };
-
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- base.Reflection(sb);
- try
- {
- sb.AppendLine("");
- this._originatingID.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- this._receivingID.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._requestID.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._actionID.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._fixedDatums.Count.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._variableDatums.Count.ToString(CultureInfo.InvariantCulture) + "");
- for (int idx = 0; idx < this._fixedDatums.Count; idx++)
- {
- sb.AppendLine("");
- FixedDatum aFixedDatum = (FixedDatum)this._fixedDatums[idx];
- aFixedDatum.Reflection(sb);
- sb.AppendLine("");
- }
-
- for (int idx = 0; idx < this._variableDatums.Count; idx++)
- {
- sb.AppendLine("");
- VariableDatum aVariableDatum = (VariableDatum)this._variableDatums[idx];
- aVariableDatum.Reflection(sb);
- sb.AppendLine("");
- }
-
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as ActionRequestPdu;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(ActionRequestPdu obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- ivarsEqual = base.Equals(obj);
-
- if (!this._originatingID.Equals(obj._originatingID))
- {
- ivarsEqual = false;
- }
-
- if (!this._receivingID.Equals(obj._receivingID))
- {
- ivarsEqual = false;
- }
-
- if (this._requestID != obj._requestID)
- {
- ivarsEqual = false;
- }
-
- if (this._actionID != obj._actionID)
- {
- ivarsEqual = false;
- }
-
- if (this._numberOfFixedDatumRecords != obj._numberOfFixedDatumRecords)
- {
- ivarsEqual = false;
- }
-
- if (this._numberOfVariableDatumRecords != obj._numberOfVariableDatumRecords)
- {
- ivarsEqual = false;
- }
-
- if (this._fixedDatums.Count != obj._fixedDatums.Count)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < this._fixedDatums.Count; idx++)
- {
- if (!this._fixedDatums[idx].Equals(obj._fixedDatums[idx]))
- {
- ivarsEqual = false;
- }
- }
- }
-
- if (this._variableDatums.Count != obj._variableDatums.Count)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < this._variableDatums.Count; idx++)
- {
- if (!this._variableDatums[idx].Equals(obj._variableDatums[idx]))
- {
- ivarsEqual = false;
- }
- }
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ base.GetHashCode();
-
- result = GenerateHash(result) ^ this._originatingID.GetHashCode();
- result = GenerateHash(result) ^ this._receivingID.GetHashCode();
- result = GenerateHash(result) ^ this._requestID.GetHashCode();
- result = GenerateHash(result) ^ this._actionID.GetHashCode();
- result = GenerateHash(result) ^ this._numberOfFixedDatumRecords.GetHashCode();
- result = GenerateHash(result) ^ this._numberOfVariableDatumRecords.GetHashCode();
-
- if (this._fixedDatums.Count > 0)
- {
- for (int idx = 0; idx < this._fixedDatums.Count; idx++)
- {
- result = GenerateHash(result) ^ this._fixedDatums[idx].GetHashCode();
- }
- }
-
- if (this._variableDatums.Count > 0)
- {
- for (int idx = 0; idx < this._variableDatums.Count; idx++)
- {
- result = GenerateHash(result) ^ this._variableDatums[idx].GetHashCode();
- }
- }
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/ActionRequestReliablePdu.cs b/tests/OpenDisNet.Reference/Generated/ActionRequestReliablePdu.cs
deleted file mode 100644
index 0538f7a..0000000
--- a/tests/OpenDisNet.Reference/Generated/ActionRequestReliablePdu.cs
+++ /dev/null
@@ -1,615 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Section 5.3.12.6: request from a simulation manager to a managed entity to perform a specified action. COMPLETE
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(FixedDatum))]
- [XmlInclude(typeof(VariableDatum))]
- public partial class ActionRequestReliablePdu : SimulationManagementWithReliabilityFamilyPdu, IEquatable
- {
- ///
- /// level of reliability service used for this transaction
- ///
- private byte _requiredReliabilityService;
-
- ///
- /// padding
- ///
- private ushort _pad1;
-
- ///
- /// padding
- ///
- private byte _pad2;
-
- ///
- /// request ID
- ///
- private uint _requestID;
-
- ///
- /// request ID
- ///
- private uint _actionID;
-
- ///
- /// Fixed datum record count
- ///
- private uint _numberOfFixedDatumRecords;
-
- ///
- /// variable datum record count
- ///
- private uint _numberOfVariableDatumRecords;
-
- ///
- /// Fixed datum records
- ///
- private List _fixedDatumRecords = new List();
-
- ///
- /// Variable datum records
- ///
- private List _variableDatumRecords = new List();
-
- ///
- /// Initializes a new instance of the class.
- ///
- public ActionRequestReliablePdu()
- {
- PduType = (byte)56;
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(ActionRequestReliablePdu left, ActionRequestReliablePdu right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(ActionRequestReliablePdu left, ActionRequestReliablePdu right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public override int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize = base.GetMarshalledSize();
- marshalSize += 1; // this._requiredReliabilityService
- marshalSize += 2; // this._pad1
- marshalSize += 1; // this._pad2
- marshalSize += 4; // this._requestID
- marshalSize += 4; // this._actionID
- marshalSize += 4; // this._numberOfFixedDatumRecords
- marshalSize += 4; // this._numberOfVariableDatumRecords
- for (int idx = 0; idx < this._fixedDatumRecords.Count; idx++)
- {
- FixedDatum listElement = (FixedDatum)this._fixedDatumRecords[idx];
- marshalSize += listElement.GetMarshalledSize();
- }
-
- for (int idx = 0; idx < this._variableDatumRecords.Count; idx++)
- {
- VariableDatum listElement = (VariableDatum)this._variableDatumRecords[idx];
- marshalSize += listElement.GetMarshalledSize();
- }
-
- return marshalSize;
- }
-
- ///
- /// Gets or sets the level of reliability service used for this transaction
- ///
- [XmlElement(Type = typeof(byte), ElementName = "requiredReliabilityService")]
- public byte RequiredReliabilityService
- {
- get
- {
- return this._requiredReliabilityService;
- }
-
- set
- {
- this._requiredReliabilityService = value;
- }
- }
-
- ///
- /// Gets or sets the padding
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "pad1")]
- public ushort Pad1
- {
- get
- {
- return this._pad1;
- }
-
- set
- {
- this._pad1 = value;
- }
- }
-
- ///
- /// Gets or sets the padding
- ///
- [XmlElement(Type = typeof(byte), ElementName = "pad2")]
- public byte Pad2
- {
- get
- {
- return this._pad2;
- }
-
- set
- {
- this._pad2 = value;
- }
- }
-
- ///
- /// Gets or sets the request ID
- ///
- [XmlElement(Type = typeof(uint), ElementName = "requestID")]
- public uint RequestID
- {
- get
- {
- return this._requestID;
- }
-
- set
- {
- this._requestID = value;
- }
- }
-
- ///
- /// Gets or sets the request ID
- ///
- [XmlElement(Type = typeof(uint), ElementName = "actionID")]
- public uint ActionID
- {
- get
- {
- return this._actionID;
- }
-
- set
- {
- this._actionID = value;
- }
- }
-
- ///
- /// Note that setting this value will not change the marshalled value. The list whose length this describes is used for that purpose.
- /// The getnumberOfFixedDatumRecords method will also be based on the actual list length rather than this value.
- /// The method is simply here for completeness and should not be used for any computations.
- ///
- [XmlElement(Type = typeof(uint), ElementName = "numberOfFixedDatumRecords")]
- public uint NumberOfFixedDatumRecords
- {
- get
- {
- return this._numberOfFixedDatumRecords;
- }
-
- set
- {
- this._numberOfFixedDatumRecords = value;
- }
- }
-
- ///
- /// Note that setting this value will not change the marshalled value. The list whose length this describes is used for that purpose.
- /// The getnumberOfVariableDatumRecords method will also be based on the actual list length rather than this value.
- /// The method is simply here for completeness and should not be used for any computations.
- ///
- [XmlElement(Type = typeof(uint), ElementName = "numberOfVariableDatumRecords")]
- public uint NumberOfVariableDatumRecords
- {
- get
- {
- return this._numberOfVariableDatumRecords;
- }
-
- set
- {
- this._numberOfVariableDatumRecords = value;
- }
- }
-
- ///
- /// Gets or sets the Fixed datum records
- ///
- [XmlElement(ElementName = "fixedDatumRecordsList", Type = typeof(List))]
- public List FixedDatumRecords
- {
- get
- {
- return this._fixedDatumRecords;
- }
- }
-
- ///
- /// Gets or sets the Variable datum records
- ///
- [XmlElement(ElementName = "variableDatumRecordsList", Type = typeof(List))]
- public List VariableDatumRecords
- {
- get
- {
- return this._variableDatumRecords;
- }
- }
-
- ///
- /// Automatically sets the length of the marshalled data, then calls the marshal method.
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- public override void MarshalAutoLengthSet(DataOutputStream dos)
- {
- // Set the length prior to marshalling data
- this.Length = (ushort)this.GetMarshalledSize();
- this.Marshal(dos);
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Marshal(DataOutputStream dos)
- {
- base.Marshal(dos);
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedByte((byte)this._requiredReliabilityService);
- dos.WriteUnsignedShort((ushort)this._pad1);
- dos.WriteUnsignedByte((byte)this._pad2);
- dos.WriteUnsignedInt((uint)this._requestID);
- dos.WriteUnsignedInt((uint)this._actionID);
- dos.WriteUnsignedInt((uint)this._fixedDatumRecords.Count);
- dos.WriteUnsignedInt((uint)this._variableDatumRecords.Count);
-
- for (int idx = 0; idx < this._fixedDatumRecords.Count; idx++)
- {
- FixedDatum aFixedDatum = (FixedDatum)this._fixedDatumRecords[idx];
- aFixedDatum.Marshal(dos);
- }
-
- for (int idx = 0; idx < this._variableDatumRecords.Count; idx++)
- {
- VariableDatum aVariableDatum = (VariableDatum)this._variableDatumRecords[idx];
- aVariableDatum.Marshal(dos);
- }
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Unmarshal(DataInputStream dis)
- {
- base.Unmarshal(dis);
-
- if (dis != null)
- {
- try
- {
- this._requiredReliabilityService = dis.ReadUnsignedByte();
- this._pad1 = dis.ReadUnsignedShort();
- this._pad2 = dis.ReadUnsignedByte();
- this._requestID = dis.ReadUnsignedInt();
- this._actionID = dis.ReadUnsignedInt();
- this._numberOfFixedDatumRecords = dis.ReadUnsignedInt();
- this._numberOfVariableDatumRecords = dis.ReadUnsignedInt();
- for (int idx = 0; idx < this.NumberOfFixedDatumRecords; idx++)
- {
- FixedDatum anX = new FixedDatum();
- anX.Unmarshal(dis);
- this._fixedDatumRecords.Add(anX);
- };
-
- for (int idx = 0; idx < this.NumberOfVariableDatumRecords; idx++)
- {
- VariableDatum anX = new VariableDatum();
- anX.Unmarshal(dis);
- this._variableDatumRecords.Add(anX);
- };
-
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- base.Reflection(sb);
- try
- {
- sb.AppendLine("" + this._requiredReliabilityService.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._pad1.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._pad2.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._requestID.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._actionID.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._fixedDatumRecords.Count.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._variableDatumRecords.Count.ToString(CultureInfo.InvariantCulture) + "");
- for (int idx = 0; idx < this._fixedDatumRecords.Count; idx++)
- {
- sb.AppendLine("");
- FixedDatum aFixedDatum = (FixedDatum)this._fixedDatumRecords[idx];
- aFixedDatum.Reflection(sb);
- sb.AppendLine("");
- }
-
- for (int idx = 0; idx < this._variableDatumRecords.Count; idx++)
- {
- sb.AppendLine("");
- VariableDatum aVariableDatum = (VariableDatum)this._variableDatumRecords[idx];
- aVariableDatum.Reflection(sb);
- sb.AppendLine("");
- }
-
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as ActionRequestReliablePdu;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(ActionRequestReliablePdu obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- ivarsEqual = base.Equals(obj);
-
- if (this._requiredReliabilityService != obj._requiredReliabilityService)
- {
- ivarsEqual = false;
- }
-
- if (this._pad1 != obj._pad1)
- {
- ivarsEqual = false;
- }
-
- if (this._pad2 != obj._pad2)
- {
- ivarsEqual = false;
- }
-
- if (this._requestID != obj._requestID)
- {
- ivarsEqual = false;
- }
-
- if (this._actionID != obj._actionID)
- {
- ivarsEqual = false;
- }
-
- if (this._numberOfFixedDatumRecords != obj._numberOfFixedDatumRecords)
- {
- ivarsEqual = false;
- }
-
- if (this._numberOfVariableDatumRecords != obj._numberOfVariableDatumRecords)
- {
- ivarsEqual = false;
- }
-
- if (this._fixedDatumRecords.Count != obj._fixedDatumRecords.Count)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < this._fixedDatumRecords.Count; idx++)
- {
- if (!this._fixedDatumRecords[idx].Equals(obj._fixedDatumRecords[idx]))
- {
- ivarsEqual = false;
- }
- }
- }
-
- if (this._variableDatumRecords.Count != obj._variableDatumRecords.Count)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < this._variableDatumRecords.Count; idx++)
- {
- if (!this._variableDatumRecords[idx].Equals(obj._variableDatumRecords[idx]))
- {
- ivarsEqual = false;
- }
- }
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ base.GetHashCode();
-
- result = GenerateHash(result) ^ this._requiredReliabilityService.GetHashCode();
- result = GenerateHash(result) ^ this._pad1.GetHashCode();
- result = GenerateHash(result) ^ this._pad2.GetHashCode();
- result = GenerateHash(result) ^ this._requestID.GetHashCode();
- result = GenerateHash(result) ^ this._actionID.GetHashCode();
- result = GenerateHash(result) ^ this._numberOfFixedDatumRecords.GetHashCode();
- result = GenerateHash(result) ^ this._numberOfVariableDatumRecords.GetHashCode();
-
- if (this._fixedDatumRecords.Count > 0)
- {
- for (int idx = 0; idx < this._fixedDatumRecords.Count; idx++)
- {
- result = GenerateHash(result) ^ this._fixedDatumRecords[idx].GetHashCode();
- }
- }
-
- if (this._variableDatumRecords.Count > 0)
- {
- for (int idx = 0; idx < this._variableDatumRecords.Count; idx++)
- {
- result = GenerateHash(result) ^ this._variableDatumRecords[idx].GetHashCode();
- }
- }
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/ActionResponsePdu.cs b/tests/OpenDisNet.Reference/Generated/ActionResponsePdu.cs
deleted file mode 100644
index 2a7fcd5..0000000
--- a/tests/OpenDisNet.Reference/Generated/ActionResponsePdu.cs
+++ /dev/null
@@ -1,588 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Section 7.5.8. response to an action request PDU. COMPLETE
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(EntityID))]
- [XmlInclude(typeof(FixedDatum))]
- [XmlInclude(typeof(VariableDatum))]
- public partial class ActionResponsePdu : SimulationManagementFamilyPdu, IEquatable
- {
- ///
- /// Identifier for originating entity(or simulation)
- ///
- private EntityID _originatingID = new EntityID();
-
- ///
- /// Identifier for the receiving entity(or simulation)
- ///
- private EntityID _receivingID = new EntityID();
-
- ///
- /// Request ID that is unique
- ///
- private uint _requestID;
-
- ///
- /// Status of response
- ///
- private uint _requestStatus;
-
- ///
- /// Number of fixed datum records
- ///
- private uint _numberOfFixedDatumRecords;
-
- ///
- /// Number of variable datum records
- ///
- private uint _numberOfVariableDatumRecords;
-
- ///
- /// variable length list of fixed datums
- ///
- private List _fixedDatums = new List();
-
- ///
- /// variable length list of variable length datums
- ///
- private List _variableDatums = new List();
-
- ///
- /// Initializes a new instance of the class.
- ///
- public ActionResponsePdu()
- {
- PduType = (byte)17;
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(ActionResponsePdu left, ActionResponsePdu right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(ActionResponsePdu left, ActionResponsePdu right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public override int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize = base.GetMarshalledSize();
- marshalSize += this._originatingID.GetMarshalledSize(); // this._originatingID
- marshalSize += this._receivingID.GetMarshalledSize(); // this._receivingID
- marshalSize += 4; // this._requestID
- marshalSize += 4; // this._requestStatus
- marshalSize += 4; // this._numberOfFixedDatumRecords
- marshalSize += 4; // this._numberOfVariableDatumRecords
- for (int idx = 0; idx < this._fixedDatums.Count; idx++)
- {
- FixedDatum listElement = (FixedDatum)this._fixedDatums[idx];
- marshalSize += listElement.GetMarshalledSize();
- }
-
- for (int idx = 0; idx < this._variableDatums.Count; idx++)
- {
- VariableDatum listElement = (VariableDatum)this._variableDatums[idx];
- marshalSize += listElement.GetMarshalledSize();
- }
-
- return marshalSize;
- }
-
- ///
- /// Gets or sets the Identifier for originating entity(or simulation)
- ///
- [XmlElement(Type = typeof(EntityID), ElementName = "originatingID")]
- public EntityID OriginatingID
- {
- get
- {
- return this._originatingID;
- }
-
- set
- {
- this._originatingID = value;
- }
- }
-
- ///
- /// Gets or sets the Identifier for the receiving entity(or simulation)
- ///
- [XmlElement(Type = typeof(EntityID), ElementName = "receivingID")]
- public EntityID ReceivingID
- {
- get
- {
- return this._receivingID;
- }
-
- set
- {
- this._receivingID = value;
- }
- }
-
- ///
- /// Gets or sets the Request ID that is unique
- ///
- [XmlElement(Type = typeof(uint), ElementName = "requestID")]
- public uint RequestID
- {
- get
- {
- return this._requestID;
- }
-
- set
- {
- this._requestID = value;
- }
- }
-
- ///
- /// Gets or sets the Status of response
- ///
- [XmlElement(Type = typeof(uint), ElementName = "requestStatus")]
- public uint RequestStatus
- {
- get
- {
- return this._requestStatus;
- }
-
- set
- {
- this._requestStatus = value;
- }
- }
-
- ///
- /// Note that setting this value will not change the marshalled value. The list whose length this describes is used for that purpose.
- /// The getnumberOfFixedDatumRecords method will also be based on the actual list length rather than this value.
- /// The method is simply here for completeness and should not be used for any computations.
- ///
- [XmlElement(Type = typeof(uint), ElementName = "numberOfFixedDatumRecords")]
- public uint NumberOfFixedDatumRecords
- {
- get
- {
- return this._numberOfFixedDatumRecords;
- }
-
- set
- {
- this._numberOfFixedDatumRecords = value;
- }
- }
-
- ///
- /// Note that setting this value will not change the marshalled value. The list whose length this describes is used for that purpose.
- /// The getnumberOfVariableDatumRecords method will also be based on the actual list length rather than this value.
- /// The method is simply here for completeness and should not be used for any computations.
- ///
- [XmlElement(Type = typeof(uint), ElementName = "numberOfVariableDatumRecords")]
- public uint NumberOfVariableDatumRecords
- {
- get
- {
- return this._numberOfVariableDatumRecords;
- }
-
- set
- {
- this._numberOfVariableDatumRecords = value;
- }
- }
-
- ///
- /// Gets or sets the variable length list of fixed datums
- ///
- [XmlElement(ElementName = "fixedDatumsList", Type = typeof(List))]
- public List FixedDatums
- {
- get
- {
- return this._fixedDatums;
- }
- }
-
- ///
- /// Gets or sets the variable length list of variable length datums
- ///
- [XmlElement(ElementName = "variableDatumsList", Type = typeof(List))]
- public List VariableDatums
- {
- get
- {
- return this._variableDatums;
- }
- }
-
- ///
- /// Automatically sets the length of the marshalled data, then calls the marshal method.
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- public override void MarshalAutoLengthSet(DataOutputStream dos)
- {
- // Set the length prior to marshalling data
- this.Length = (ushort)this.GetMarshalledSize();
- this.Marshal(dos);
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Marshal(DataOutputStream dos)
- {
- base.Marshal(dos);
- if (dos != null)
- {
- try
- {
- this._originatingID.Marshal(dos);
- this._receivingID.Marshal(dos);
- dos.WriteUnsignedInt((uint)this._requestID);
- dos.WriteUnsignedInt((uint)this._requestStatus);
- dos.WriteUnsignedInt((uint)this._fixedDatums.Count);
- dos.WriteUnsignedInt((uint)this._variableDatums.Count);
-
- for (int idx = 0; idx < this._fixedDatums.Count; idx++)
- {
- FixedDatum aFixedDatum = (FixedDatum)this._fixedDatums[idx];
- aFixedDatum.Marshal(dos);
- }
-
- for (int idx = 0; idx < this._variableDatums.Count; idx++)
- {
- VariableDatum aVariableDatum = (VariableDatum)this._variableDatums[idx];
- aVariableDatum.Marshal(dos);
- }
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Unmarshal(DataInputStream dis)
- {
- base.Unmarshal(dis);
-
- if (dis != null)
- {
- try
- {
- this._originatingID.Unmarshal(dis);
- this._receivingID.Unmarshal(dis);
- this._requestID = dis.ReadUnsignedInt();
- this._requestStatus = dis.ReadUnsignedInt();
- this._numberOfFixedDatumRecords = dis.ReadUnsignedInt();
- this._numberOfVariableDatumRecords = dis.ReadUnsignedInt();
- for (int idx = 0; idx < this.NumberOfFixedDatumRecords; idx++)
- {
- FixedDatum anX = new FixedDatum();
- anX.Unmarshal(dis);
- this._fixedDatums.Add(anX);
- };
-
- for (int idx = 0; idx < this.NumberOfVariableDatumRecords; idx++)
- {
- VariableDatum anX = new VariableDatum();
- anX.Unmarshal(dis);
- this._variableDatums.Add(anX);
- };
-
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- base.Reflection(sb);
- try
- {
- sb.AppendLine("");
- this._originatingID.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- this._receivingID.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._requestID.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._requestStatus.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._fixedDatums.Count.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._variableDatums.Count.ToString(CultureInfo.InvariantCulture) + "");
- for (int idx = 0; idx < this._fixedDatums.Count; idx++)
- {
- sb.AppendLine("");
- FixedDatum aFixedDatum = (FixedDatum)this._fixedDatums[idx];
- aFixedDatum.Reflection(sb);
- sb.AppendLine("");
- }
-
- for (int idx = 0; idx < this._variableDatums.Count; idx++)
- {
- sb.AppendLine("");
- VariableDatum aVariableDatum = (VariableDatum)this._variableDatums[idx];
- aVariableDatum.Reflection(sb);
- sb.AppendLine("");
- }
-
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as ActionResponsePdu;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(ActionResponsePdu obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- ivarsEqual = base.Equals(obj);
-
- if (!this._originatingID.Equals(obj._originatingID))
- {
- ivarsEqual = false;
- }
-
- if (!this._receivingID.Equals(obj._receivingID))
- {
- ivarsEqual = false;
- }
-
- if (this._requestID != obj._requestID)
- {
- ivarsEqual = false;
- }
-
- if (this._requestStatus != obj._requestStatus)
- {
- ivarsEqual = false;
- }
-
- if (this._numberOfFixedDatumRecords != obj._numberOfFixedDatumRecords)
- {
- ivarsEqual = false;
- }
-
- if (this._numberOfVariableDatumRecords != obj._numberOfVariableDatumRecords)
- {
- ivarsEqual = false;
- }
-
- if (this._fixedDatums.Count != obj._fixedDatums.Count)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < this._fixedDatums.Count; idx++)
- {
- if (!this._fixedDatums[idx].Equals(obj._fixedDatums[idx]))
- {
- ivarsEqual = false;
- }
- }
- }
-
- if (this._variableDatums.Count != obj._variableDatums.Count)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < this._variableDatums.Count; idx++)
- {
- if (!this._variableDatums[idx].Equals(obj._variableDatums[idx]))
- {
- ivarsEqual = false;
- }
- }
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ base.GetHashCode();
-
- result = GenerateHash(result) ^ this._originatingID.GetHashCode();
- result = GenerateHash(result) ^ this._receivingID.GetHashCode();
- result = GenerateHash(result) ^ this._requestID.GetHashCode();
- result = GenerateHash(result) ^ this._requestStatus.GetHashCode();
- result = GenerateHash(result) ^ this._numberOfFixedDatumRecords.GetHashCode();
- result = GenerateHash(result) ^ this._numberOfVariableDatumRecords.GetHashCode();
-
- if (this._fixedDatums.Count > 0)
- {
- for (int idx = 0; idx < this._fixedDatums.Count; idx++)
- {
- result = GenerateHash(result) ^ this._fixedDatums[idx].GetHashCode();
- }
- }
-
- if (this._variableDatums.Count > 0)
- {
- for (int idx = 0; idx < this._variableDatums.Count; idx++)
- {
- result = GenerateHash(result) ^ this._variableDatums[idx].GetHashCode();
- }
- }
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/ActionResponseReliablePdu.cs b/tests/OpenDisNet.Reference/Generated/ActionResponseReliablePdu.cs
deleted file mode 100644
index e6d6197..0000000
--- a/tests/OpenDisNet.Reference/Generated/ActionResponseReliablePdu.cs
+++ /dev/null
@@ -1,519 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Section 5.3.12.7: Response from an entity to an action request PDU. COMPLETE
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(FixedDatum))]
- [XmlInclude(typeof(VariableDatum))]
- public partial class ActionResponseReliablePdu : SimulationManagementWithReliabilityFamilyPdu, IEquatable
- {
- ///
- /// request ID
- ///
- private uint _requestID;
-
- ///
- /// status of response
- ///
- private uint _responseStatus;
-
- ///
- /// Fixed datum record count
- ///
- private uint _numberOfFixedDatumRecords;
-
- ///
- /// variable datum record count
- ///
- private uint _numberOfVariableDatumRecords;
-
- ///
- /// Fixed datum records
- ///
- private List _fixedDatumRecords = new List();
-
- ///
- /// Variable datum records
- ///
- private List _variableDatumRecords = new List();
-
- ///
- /// Initializes a new instance of the class.
- ///
- public ActionResponseReliablePdu()
- {
- PduType = (byte)57;
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(ActionResponseReliablePdu left, ActionResponseReliablePdu right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(ActionResponseReliablePdu left, ActionResponseReliablePdu right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public override int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize = base.GetMarshalledSize();
- marshalSize += 4; // this._requestID
- marshalSize += 4; // this._responseStatus
- marshalSize += 4; // this._numberOfFixedDatumRecords
- marshalSize += 4; // this._numberOfVariableDatumRecords
- for (int idx = 0; idx < this._fixedDatumRecords.Count; idx++)
- {
- FixedDatum listElement = (FixedDatum)this._fixedDatumRecords[idx];
- marshalSize += listElement.GetMarshalledSize();
- }
-
- for (int idx = 0; idx < this._variableDatumRecords.Count; idx++)
- {
- VariableDatum listElement = (VariableDatum)this._variableDatumRecords[idx];
- marshalSize += listElement.GetMarshalledSize();
- }
-
- return marshalSize;
- }
-
- ///
- /// Gets or sets the request ID
- ///
- [XmlElement(Type = typeof(uint), ElementName = "requestID")]
- public uint RequestID
- {
- get
- {
- return this._requestID;
- }
-
- set
- {
- this._requestID = value;
- }
- }
-
- ///
- /// Gets or sets the status of response
- ///
- [XmlElement(Type = typeof(uint), ElementName = "responseStatus")]
- public uint ResponseStatus
- {
- get
- {
- return this._responseStatus;
- }
-
- set
- {
- this._responseStatus = value;
- }
- }
-
- ///
- /// Note that setting this value will not change the marshalled value. The list whose length this describes is used for that purpose.
- /// The getnumberOfFixedDatumRecords method will also be based on the actual list length rather than this value.
- /// The method is simply here for completeness and should not be used for any computations.
- ///
- [XmlElement(Type = typeof(uint), ElementName = "numberOfFixedDatumRecords")]
- public uint NumberOfFixedDatumRecords
- {
- get
- {
- return this._numberOfFixedDatumRecords;
- }
-
- set
- {
- this._numberOfFixedDatumRecords = value;
- }
- }
-
- ///
- /// Note that setting this value will not change the marshalled value. The list whose length this describes is used for that purpose.
- /// The getnumberOfVariableDatumRecords method will also be based on the actual list length rather than this value.
- /// The method is simply here for completeness and should not be used for any computations.
- ///
- [XmlElement(Type = typeof(uint), ElementName = "numberOfVariableDatumRecords")]
- public uint NumberOfVariableDatumRecords
- {
- get
- {
- return this._numberOfVariableDatumRecords;
- }
-
- set
- {
- this._numberOfVariableDatumRecords = value;
- }
- }
-
- ///
- /// Gets or sets the Fixed datum records
- ///
- [XmlElement(ElementName = "fixedDatumRecordsList", Type = typeof(List))]
- public List FixedDatumRecords
- {
- get
- {
- return this._fixedDatumRecords;
- }
- }
-
- ///
- /// Gets or sets the Variable datum records
- ///
- [XmlElement(ElementName = "variableDatumRecordsList", Type = typeof(List))]
- public List VariableDatumRecords
- {
- get
- {
- return this._variableDatumRecords;
- }
- }
-
- ///
- /// Automatically sets the length of the marshalled data, then calls the marshal method.
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- public override void MarshalAutoLengthSet(DataOutputStream dos)
- {
- // Set the length prior to marshalling data
- this.Length = (ushort)this.GetMarshalledSize();
- this.Marshal(dos);
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Marshal(DataOutputStream dos)
- {
- base.Marshal(dos);
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedInt((uint)this._requestID);
- dos.WriteUnsignedInt((uint)this._responseStatus);
- dos.WriteUnsignedInt((uint)this._fixedDatumRecords.Count);
- dos.WriteUnsignedInt((uint)this._variableDatumRecords.Count);
-
- for (int idx = 0; idx < this._fixedDatumRecords.Count; idx++)
- {
- FixedDatum aFixedDatum = (FixedDatum)this._fixedDatumRecords[idx];
- aFixedDatum.Marshal(dos);
- }
-
- for (int idx = 0; idx < this._variableDatumRecords.Count; idx++)
- {
- VariableDatum aVariableDatum = (VariableDatum)this._variableDatumRecords[idx];
- aVariableDatum.Marshal(dos);
- }
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Unmarshal(DataInputStream dis)
- {
- base.Unmarshal(dis);
-
- if (dis != null)
- {
- try
- {
- this._requestID = dis.ReadUnsignedInt();
- this._responseStatus = dis.ReadUnsignedInt();
- this._numberOfFixedDatumRecords = dis.ReadUnsignedInt();
- this._numberOfVariableDatumRecords = dis.ReadUnsignedInt();
- for (int idx = 0; idx < this.NumberOfFixedDatumRecords; idx++)
- {
- FixedDatum anX = new FixedDatum();
- anX.Unmarshal(dis);
- this._fixedDatumRecords.Add(anX);
- };
-
- for (int idx = 0; idx < this.NumberOfVariableDatumRecords; idx++)
- {
- VariableDatum anX = new VariableDatum();
- anX.Unmarshal(dis);
- this._variableDatumRecords.Add(anX);
- };
-
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- base.Reflection(sb);
- try
- {
- sb.AppendLine("" + this._requestID.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._responseStatus.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._fixedDatumRecords.Count.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._variableDatumRecords.Count.ToString(CultureInfo.InvariantCulture) + "");
- for (int idx = 0; idx < this._fixedDatumRecords.Count; idx++)
- {
- sb.AppendLine("");
- FixedDatum aFixedDatum = (FixedDatum)this._fixedDatumRecords[idx];
- aFixedDatum.Reflection(sb);
- sb.AppendLine("");
- }
-
- for (int idx = 0; idx < this._variableDatumRecords.Count; idx++)
- {
- sb.AppendLine("");
- VariableDatum aVariableDatum = (VariableDatum)this._variableDatumRecords[idx];
- aVariableDatum.Reflection(sb);
- sb.AppendLine("");
- }
-
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as ActionResponseReliablePdu;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(ActionResponseReliablePdu obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- ivarsEqual = base.Equals(obj);
-
- if (this._requestID != obj._requestID)
- {
- ivarsEqual = false;
- }
-
- if (this._responseStatus != obj._responseStatus)
- {
- ivarsEqual = false;
- }
-
- if (this._numberOfFixedDatumRecords != obj._numberOfFixedDatumRecords)
- {
- ivarsEqual = false;
- }
-
- if (this._numberOfVariableDatumRecords != obj._numberOfVariableDatumRecords)
- {
- ivarsEqual = false;
- }
-
- if (this._fixedDatumRecords.Count != obj._fixedDatumRecords.Count)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < this._fixedDatumRecords.Count; idx++)
- {
- if (!this._fixedDatumRecords[idx].Equals(obj._fixedDatumRecords[idx]))
- {
- ivarsEqual = false;
- }
- }
- }
-
- if (this._variableDatumRecords.Count != obj._variableDatumRecords.Count)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < this._variableDatumRecords.Count; idx++)
- {
- if (!this._variableDatumRecords[idx].Equals(obj._variableDatumRecords[idx]))
- {
- ivarsEqual = false;
- }
- }
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ base.GetHashCode();
-
- result = GenerateHash(result) ^ this._requestID.GetHashCode();
- result = GenerateHash(result) ^ this._responseStatus.GetHashCode();
- result = GenerateHash(result) ^ this._numberOfFixedDatumRecords.GetHashCode();
- result = GenerateHash(result) ^ this._numberOfVariableDatumRecords.GetHashCode();
-
- if (this._fixedDatumRecords.Count > 0)
- {
- for (int idx = 0; idx < this._fixedDatumRecords.Count; idx++)
- {
- result = GenerateHash(result) ^ this._fixedDatumRecords[idx].GetHashCode();
- }
- }
-
- if (this._variableDatumRecords.Count > 0)
- {
- for (int idx = 0; idx < this._variableDatumRecords.Count; idx++)
- {
- result = GenerateHash(result) ^ this._variableDatumRecords[idx].GetHashCode();
- }
- }
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/AggregateIdentifier.cs b/tests/OpenDisNet.Reference/Generated/AggregateIdentifier.cs
deleted file mode 100644
index 4d02b8a..0000000
--- a/tests/OpenDisNet.Reference/Generated/AggregateIdentifier.cs
+++ /dev/null
@@ -1,312 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// The unique designation of each aggrgate in an exercise is specified by an aggregate identifier record. The aggregate ID is not an entity and shall not be treated as such. Section 6.2.3.
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(SimulationAddress))]
- public partial class AggregateIdentifier
- {
- ///
- /// Simulation address, ie site and application, the first two fields of the entity ID
- ///
- private SimulationAddress _simulationAddress = new SimulationAddress();
-
- ///
- /// the aggregate ID
- ///
- private ushort _aggregateID;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public AggregateIdentifier()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(AggregateIdentifier left, AggregateIdentifier right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(AggregateIdentifier left, AggregateIdentifier right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += this._simulationAddress.GetMarshalledSize(); // this._simulationAddress
- marshalSize += 2; // this._aggregateID
- return marshalSize;
- }
-
- ///
- /// Gets or sets the Simulation address, ie site and application, the first two fields of the entity ID
- ///
- [XmlElement(Type = typeof(SimulationAddress), ElementName = "simulationAddress")]
- public SimulationAddress SimulationAddress
- {
- get
- {
- return this._simulationAddress;
- }
-
- set
- {
- this._simulationAddress = value;
- }
- }
-
- ///
- /// Gets or sets the the aggregate ID
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "aggregateID")]
- public ushort AggregateID
- {
- get
- {
- return this._aggregateID;
- }
-
- set
- {
- this._aggregateID = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- this._simulationAddress.Marshal(dos);
- dos.WriteUnsignedShort((ushort)this._aggregateID);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._simulationAddress.Unmarshal(dis);
- this._aggregateID = dis.ReadUnsignedShort();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("");
- this._simulationAddress.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._aggregateID.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as AggregateIdentifier;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(AggregateIdentifier obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (!this._simulationAddress.Equals(obj._simulationAddress))
- {
- ivarsEqual = false;
- }
-
- if (this._aggregateID != obj._aggregateID)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._simulationAddress.GetHashCode();
- result = GenerateHash(result) ^ this._aggregateID.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/AggregateMarking.cs b/tests/OpenDisNet.Reference/Generated/AggregateMarking.cs
deleted file mode 100644
index 0bebe1a..0000000
--- a/tests/OpenDisNet.Reference/Generated/AggregateMarking.cs
+++ /dev/null
@@ -1,335 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Specifies the character set used in the first byte, followed by up to 31 characters of text data. Section 6.2.4.
- ///
- [Serializable]
- [XmlRoot]
- public partial class AggregateMarking
- {
- ///
- /// The character set
- ///
- private byte _characterSet;
-
- ///
- /// The characters
- ///
- private byte[] _characters = new byte[31];
-
- ///
- /// Initializes a new instance of the class.
- ///
- public AggregateMarking()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(AggregateMarking left, AggregateMarking right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(AggregateMarking left, AggregateMarking right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += 1; // this._characterSet
- marshalSize += 31 * 1; // _characters
- return marshalSize;
- }
-
- ///
- /// Gets or sets the The character set
- ///
- [XmlElement(Type = typeof(byte), ElementName = "characterSet")]
- public byte CharacterSet
- {
- get
- {
- return this._characterSet;
- }
-
- set
- {
- this._characterSet = value;
- }
- }
-
- ///
- /// Gets or sets the The characters
- ///
- [XmlArray(ElementName = "characters")]
- public byte[] Characters
- {
- get
- {
- return this._characters;
- }
-
- set
- {
- this._characters = value;
- }
-}
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedByte((byte)this._characterSet);
-
- for (int idx = 0; idx < this._characters.Length; idx++)
- {
- dos.WriteUnsignedByte(this._characters[idx]);
- }
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._characterSet = dis.ReadUnsignedByte();
- for (int idx = 0; idx < this._characters.Length; idx++)
- {
- this._characters[idx] = dis.ReadUnsignedByte();
- }
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("" + this._characterSet.ToString(CultureInfo.InvariantCulture) + "");
- for (int idx = 0; idx < this._characters.Length; idx++)
- {
- sb.AppendLine("" + this._characters[idx] + "");
- }
-
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as AggregateMarking;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(AggregateMarking obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (this._characterSet != obj._characterSet)
- {
- ivarsEqual = false;
- }
-
- if (obj._characters.Length != 31)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < 31; idx++)
- {
- if (this._characters[idx] != obj._characters[idx])
- {
- ivarsEqual = false;
- }
- }
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._characterSet.GetHashCode();
-
- for (int idx = 0; idx < 31; idx++)
- {
- result = GenerateHash(result) ^ this._characters[idx].GetHashCode();
- }
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/AggregateType.cs b/tests/OpenDisNet.Reference/Generated/AggregateType.cs
deleted file mode 100644
index 9caa34b..0000000
--- a/tests/OpenDisNet.Reference/Generated/AggregateType.cs
+++ /dev/null
@@ -1,463 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Identifies the type and organization of an aggregate. Section 6.2.5
- ///
- [Serializable]
- [XmlRoot]
- public partial class AggregateType
- {
- ///
- /// Grouping criterion used to group the aggregate. Enumeration from EBV document
- ///
- private byte _aggregateKind;
-
- ///
- /// Domain of entity (air, surface, subsurface, space, etc) Zero means domain does not apply.
- ///
- private byte _domain;
-
- ///
- /// country to which the design of the entity is attributed
- ///
- private ushort _country;
-
- ///
- /// category of entity
- ///
- private byte _category;
-
- ///
- /// subcategory of entity
- ///
- private byte _subcategory;
-
- ///
- /// specific info based on subcategory field
- ///
- private byte _specific;
-
- private byte _extra;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public AggregateType()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(AggregateType left, AggregateType right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(AggregateType left, AggregateType right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += 1; // this._aggregateKind
- marshalSize += 1; // this._domain
- marshalSize += 2; // this._country
- marshalSize += 1; // this._category
- marshalSize += 1; // this._subcategory
- marshalSize += 1; // this._specific
- marshalSize += 1; // this._extra
- return marshalSize;
- }
-
- ///
- /// Gets or sets the Grouping criterion used to group the aggregate. Enumeration from EBV document
- ///
- [XmlElement(Type = typeof(byte), ElementName = "aggregateKind")]
- public byte AggregateKind
- {
- get
- {
- return this._aggregateKind;
- }
-
- set
- {
- this._aggregateKind = value;
- }
- }
-
- ///
- /// Gets or sets the Domain of entity (air, surface, subsurface, space, etc) Zero means domain does not apply.
- ///
- [XmlElement(Type = typeof(byte), ElementName = "domain")]
- public byte Domain
- {
- get
- {
- return this._domain;
- }
-
- set
- {
- this._domain = value;
- }
- }
-
- ///
- /// Gets or sets the country to which the design of the entity is attributed
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "country")]
- public ushort Country
- {
- get
- {
- return this._country;
- }
-
- set
- {
- this._country = value;
- }
- }
-
- ///
- /// Gets or sets the category of entity
- ///
- [XmlElement(Type = typeof(byte), ElementName = "category")]
- public byte Category
- {
- get
- {
- return this._category;
- }
-
- set
- {
- this._category = value;
- }
- }
-
- ///
- /// Gets or sets the subcategory of entity
- ///
- [XmlElement(Type = typeof(byte), ElementName = "subcategory")]
- public byte Subcategory
- {
- get
- {
- return this._subcategory;
- }
-
- set
- {
- this._subcategory = value;
- }
- }
-
- ///
- /// Gets or sets the specific info based on subcategory field
- ///
- [XmlElement(Type = typeof(byte), ElementName = "specific")]
- public byte Specific
- {
- get
- {
- return this._specific;
- }
-
- set
- {
- this._specific = value;
- }
- }
-
- [XmlElement(Type = typeof(byte), ElementName = "extra")]
- public byte Extra
- {
- get
- {
- return this._extra;
- }
-
- set
- {
- this._extra = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedByte((byte)this._aggregateKind);
- dos.WriteUnsignedByte((byte)this._domain);
- dos.WriteUnsignedShort((ushort)this._country);
- dos.WriteUnsignedByte((byte)this._category);
- dos.WriteUnsignedByte((byte)this._subcategory);
- dos.WriteUnsignedByte((byte)this._specific);
- dos.WriteUnsignedByte((byte)this._extra);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._aggregateKind = dis.ReadUnsignedByte();
- this._domain = dis.ReadUnsignedByte();
- this._country = dis.ReadUnsignedShort();
- this._category = dis.ReadUnsignedByte();
- this._subcategory = dis.ReadUnsignedByte();
- this._specific = dis.ReadUnsignedByte();
- this._extra = dis.ReadUnsignedByte();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("" + this._aggregateKind.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._domain.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._country.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._category.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._subcategory.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._specific.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._extra.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as AggregateType;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(AggregateType obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (this._aggregateKind != obj._aggregateKind)
- {
- ivarsEqual = false;
- }
-
- if (this._domain != obj._domain)
- {
- ivarsEqual = false;
- }
-
- if (this._country != obj._country)
- {
- ivarsEqual = false;
- }
-
- if (this._category != obj._category)
- {
- ivarsEqual = false;
- }
-
- if (this._subcategory != obj._subcategory)
- {
- ivarsEqual = false;
- }
-
- if (this._specific != obj._specific)
- {
- ivarsEqual = false;
- }
-
- if (this._extra != obj._extra)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._aggregateKind.GetHashCode();
- result = GenerateHash(result) ^ this._domain.GetHashCode();
- result = GenerateHash(result) ^ this._country.GetHashCode();
- result = GenerateHash(result) ^ this._category.GetHashCode();
- result = GenerateHash(result) ^ this._subcategory.GetHashCode();
- result = GenerateHash(result) ^ this._specific.GetHashCode();
- result = GenerateHash(result) ^ this._extra.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/AngleDeception.cs b/tests/OpenDisNet.Reference/Generated/AngleDeception.cs
deleted file mode 100644
index 9cd9d41..0000000
--- a/tests/OpenDisNet.Reference/Generated/AngleDeception.cs
+++ /dev/null
@@ -1,661 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// The Angle Deception attribute record may be used to communicate discrete values that are associated with angle deception jamming that cannot be referenced to an emitter mode. The values provided in the record records (provided in the associated Electromagnetic Emission PDU). (The victim radar beams are those that are targeted by the jammer.) Section 6.2.12.2
- ///
- [Serializable]
- [XmlRoot]
- public partial class AngleDeception
- {
- private uint _recordType = 3501;
-
- private ushort _recordLength = 48;
-
- private ushort _padding;
-
- private byte _emitterNumber;
-
- private byte _beamNumber;
-
- private byte _stateIndicator;
-
- private uint _padding2;
-
- private float _azimuthOffset;
-
- private float _azimuthWidth;
-
- private float _azimuthPullRate;
-
- private float _azimuthPullAcceleration;
-
- private float _elevationOffset;
-
- private float _elevationWidth;
-
- private float _elevationPullRate;
-
- private float _elevationPullAcceleration;
-
- private uint _padding3;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public AngleDeception()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(AngleDeception left, AngleDeception right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(AngleDeception left, AngleDeception right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += 4; // this._recordType
- marshalSize += 2; // this._recordLength
- marshalSize += 2; // this._padding
- marshalSize += 1; // this._emitterNumber
- marshalSize += 1; // this._beamNumber
- marshalSize += 1; // this._stateIndicator
- marshalSize += 4; // this._padding2
- marshalSize += 4; // this._azimuthOffset
- marshalSize += 4; // this._azimuthWidth
- marshalSize += 4; // this._azimuthPullRate
- marshalSize += 4; // this._azimuthPullAcceleration
- marshalSize += 4; // this._elevationOffset
- marshalSize += 4; // this._elevationWidth
- marshalSize += 4; // this._elevationPullRate
- marshalSize += 4; // this._elevationPullAcceleration
- marshalSize += 4; // this._padding3
- return marshalSize;
- }
-
- [XmlElement(Type = typeof(uint), ElementName = "recordType")]
- public uint RecordType
- {
- get
- {
- return this._recordType;
- }
-
- set
- {
- this._recordType = value;
- }
- }
-
- [XmlElement(Type = typeof(ushort), ElementName = "recordLength")]
- public ushort RecordLength
- {
- get
- {
- return this._recordLength;
- }
-
- set
- {
- this._recordLength = value;
- }
- }
-
- [XmlElement(Type = typeof(ushort), ElementName = "padding")]
- public ushort Padding
- {
- get
- {
- return this._padding;
- }
-
- set
- {
- this._padding = value;
- }
- }
-
- [XmlElement(Type = typeof(byte), ElementName = "emitterNumber")]
- public byte EmitterNumber
- {
- get
- {
- return this._emitterNumber;
- }
-
- set
- {
- this._emitterNumber = value;
- }
- }
-
- [XmlElement(Type = typeof(byte), ElementName = "beamNumber")]
- public byte BeamNumber
- {
- get
- {
- return this._beamNumber;
- }
-
- set
- {
- this._beamNumber = value;
- }
- }
-
- [XmlElement(Type = typeof(byte), ElementName = "stateIndicator")]
- public byte StateIndicator
- {
- get
- {
- return this._stateIndicator;
- }
-
- set
- {
- this._stateIndicator = value;
- }
- }
-
- [XmlElement(Type = typeof(uint), ElementName = "padding2")]
- public uint Padding2
- {
- get
- {
- return this._padding2;
- }
-
- set
- {
- this._padding2 = value;
- }
- }
-
- [XmlElement(Type = typeof(float), ElementName = "azimuthOffset")]
- public float AzimuthOffset
- {
- get
- {
- return this._azimuthOffset;
- }
-
- set
- {
- this._azimuthOffset = value;
- }
- }
-
- [XmlElement(Type = typeof(float), ElementName = "azimuthWidth")]
- public float AzimuthWidth
- {
- get
- {
- return this._azimuthWidth;
- }
-
- set
- {
- this._azimuthWidth = value;
- }
- }
-
- [XmlElement(Type = typeof(float), ElementName = "azimuthPullRate")]
- public float AzimuthPullRate
- {
- get
- {
- return this._azimuthPullRate;
- }
-
- set
- {
- this._azimuthPullRate = value;
- }
- }
-
- [XmlElement(Type = typeof(float), ElementName = "azimuthPullAcceleration")]
- public float AzimuthPullAcceleration
- {
- get
- {
- return this._azimuthPullAcceleration;
- }
-
- set
- {
- this._azimuthPullAcceleration = value;
- }
- }
-
- [XmlElement(Type = typeof(float), ElementName = "elevationOffset")]
- public float ElevationOffset
- {
- get
- {
- return this._elevationOffset;
- }
-
- set
- {
- this._elevationOffset = value;
- }
- }
-
- [XmlElement(Type = typeof(float), ElementName = "elevationWidth")]
- public float ElevationWidth
- {
- get
- {
- return this._elevationWidth;
- }
-
- set
- {
- this._elevationWidth = value;
- }
- }
-
- [XmlElement(Type = typeof(float), ElementName = "elevationPullRate")]
- public float ElevationPullRate
- {
- get
- {
- return this._elevationPullRate;
- }
-
- set
- {
- this._elevationPullRate = value;
- }
- }
-
- [XmlElement(Type = typeof(float), ElementName = "elevationPullAcceleration")]
- public float ElevationPullAcceleration
- {
- get
- {
- return this._elevationPullAcceleration;
- }
-
- set
- {
- this._elevationPullAcceleration = value;
- }
- }
-
- [XmlElement(Type = typeof(uint), ElementName = "padding3")]
- public uint Padding3
- {
- get
- {
- return this._padding3;
- }
-
- set
- {
- this._padding3 = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedInt((uint)this._recordType);
- dos.WriteUnsignedShort((ushort)this._recordLength);
- dos.WriteUnsignedShort((ushort)this._padding);
- dos.WriteUnsignedByte((byte)this._emitterNumber);
- dos.WriteUnsignedByte((byte)this._beamNumber);
- dos.WriteUnsignedByte((byte)this._stateIndicator);
- dos.WriteUnsignedInt((uint)this._padding2);
- dos.WriteFloat((float)this._azimuthOffset);
- dos.WriteFloat((float)this._azimuthWidth);
- dos.WriteFloat((float)this._azimuthPullRate);
- dos.WriteFloat((float)this._azimuthPullAcceleration);
- dos.WriteFloat((float)this._elevationOffset);
- dos.WriteFloat((float)this._elevationWidth);
- dos.WriteFloat((float)this._elevationPullRate);
- dos.WriteFloat((float)this._elevationPullAcceleration);
- dos.WriteUnsignedInt((uint)this._padding3);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._recordType = dis.ReadUnsignedInt();
- this._recordLength = dis.ReadUnsignedShort();
- this._padding = dis.ReadUnsignedShort();
- this._emitterNumber = dis.ReadUnsignedByte();
- this._beamNumber = dis.ReadUnsignedByte();
- this._stateIndicator = dis.ReadUnsignedByte();
- this._padding2 = dis.ReadUnsignedInt();
- this._azimuthOffset = dis.ReadFloat();
- this._azimuthWidth = dis.ReadFloat();
- this._azimuthPullRate = dis.ReadFloat();
- this._azimuthPullAcceleration = dis.ReadFloat();
- this._elevationOffset = dis.ReadFloat();
- this._elevationWidth = dis.ReadFloat();
- this._elevationPullRate = dis.ReadFloat();
- this._elevationPullAcceleration = dis.ReadFloat();
- this._padding3 = dis.ReadUnsignedInt();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("" + this._recordType.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._recordLength.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._padding.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._emitterNumber.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._beamNumber.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._stateIndicator.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._padding2.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._azimuthOffset.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._azimuthWidth.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._azimuthPullRate.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._azimuthPullAcceleration.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._elevationOffset.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._elevationWidth.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._elevationPullRate.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._elevationPullAcceleration.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._padding3.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as AngleDeception;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(AngleDeception obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (this._recordType != obj._recordType)
- {
- ivarsEqual = false;
- }
-
- if (this._recordLength != obj._recordLength)
- {
- ivarsEqual = false;
- }
-
- if (this._padding != obj._padding)
- {
- ivarsEqual = false;
- }
-
- if (this._emitterNumber != obj._emitterNumber)
- {
- ivarsEqual = false;
- }
-
- if (this._beamNumber != obj._beamNumber)
- {
- ivarsEqual = false;
- }
-
- if (this._stateIndicator != obj._stateIndicator)
- {
- ivarsEqual = false;
- }
-
- if (this._padding2 != obj._padding2)
- {
- ivarsEqual = false;
- }
-
- if (this._azimuthOffset != obj._azimuthOffset)
- {
- ivarsEqual = false;
- }
-
- if (this._azimuthWidth != obj._azimuthWidth)
- {
- ivarsEqual = false;
- }
-
- if (this._azimuthPullRate != obj._azimuthPullRate)
- {
- ivarsEqual = false;
- }
-
- if (this._azimuthPullAcceleration != obj._azimuthPullAcceleration)
- {
- ivarsEqual = false;
- }
-
- if (this._elevationOffset != obj._elevationOffset)
- {
- ivarsEqual = false;
- }
-
- if (this._elevationWidth != obj._elevationWidth)
- {
- ivarsEqual = false;
- }
-
- if (this._elevationPullRate != obj._elevationPullRate)
- {
- ivarsEqual = false;
- }
-
- if (this._elevationPullAcceleration != obj._elevationPullAcceleration)
- {
- ivarsEqual = false;
- }
-
- if (this._padding3 != obj._padding3)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._recordType.GetHashCode();
- result = GenerateHash(result) ^ this._recordLength.GetHashCode();
- result = GenerateHash(result) ^ this._padding.GetHashCode();
- result = GenerateHash(result) ^ this._emitterNumber.GetHashCode();
- result = GenerateHash(result) ^ this._beamNumber.GetHashCode();
- result = GenerateHash(result) ^ this._stateIndicator.GetHashCode();
- result = GenerateHash(result) ^ this._padding2.GetHashCode();
- result = GenerateHash(result) ^ this._azimuthOffset.GetHashCode();
- result = GenerateHash(result) ^ this._azimuthWidth.GetHashCode();
- result = GenerateHash(result) ^ this._azimuthPullRate.GetHashCode();
- result = GenerateHash(result) ^ this._azimuthPullAcceleration.GetHashCode();
- result = GenerateHash(result) ^ this._elevationOffset.GetHashCode();
- result = GenerateHash(result) ^ this._elevationWidth.GetHashCode();
- result = GenerateHash(result) ^ this._elevationPullRate.GetHashCode();
- result = GenerateHash(result) ^ this._elevationPullAcceleration.GetHashCode();
- result = GenerateHash(result) ^ this._padding3.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/AngularVelocityVector.cs b/tests/OpenDisNet.Reference/Generated/AngularVelocityVector.cs
deleted file mode 100644
index 94e683c..0000000
--- a/tests/OpenDisNet.Reference/Generated/AngularVelocityVector.cs
+++ /dev/null
@@ -1,341 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Angular velocity measured in radians per second out each of the entity's own coordinate axes. Order of measurement is angular velocity around the x, y, and z axis of the entity. The positive direction is determined by the right hand rule. Section 6.2.7
- ///
- [Serializable]
- [XmlRoot]
- public partial class AngularVelocityVector
- {
- ///
- /// velocity about the x axis
- ///
- private float _x;
-
- ///
- /// velocity about the y axis
- ///
- private float _y;
-
- ///
- /// velocity about the zaxis
- ///
- private float _z;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public AngularVelocityVector()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(AngularVelocityVector left, AngularVelocityVector right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(AngularVelocityVector left, AngularVelocityVector right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += 4; // this._x
- marshalSize += 4; // this._y
- marshalSize += 4; // this._z
- return marshalSize;
- }
-
- ///
- /// Gets or sets the velocity about the x axis
- ///
- [XmlElement(Type = typeof(float), ElementName = "x")]
- public float X
- {
- get
- {
- return this._x;
- }
-
- set
- {
- this._x = value;
- }
- }
-
- ///
- /// Gets or sets the velocity about the y axis
- ///
- [XmlElement(Type = typeof(float), ElementName = "y")]
- public float Y
- {
- get
- {
- return this._y;
- }
-
- set
- {
- this._y = value;
- }
- }
-
- ///
- /// Gets or sets the velocity about the zaxis
- ///
- [XmlElement(Type = typeof(float), ElementName = "z")]
- public float Z
- {
- get
- {
- return this._z;
- }
-
- set
- {
- this._z = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- dos.WriteFloat((float)this._x);
- dos.WriteFloat((float)this._y);
- dos.WriteFloat((float)this._z);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._x = dis.ReadFloat();
- this._y = dis.ReadFloat();
- this._z = dis.ReadFloat();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("" + this._x.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._y.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._z.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as AngularVelocityVector;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(AngularVelocityVector obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (this._x != obj._x)
- {
- ivarsEqual = false;
- }
-
- if (this._y != obj._y)
- {
- ivarsEqual = false;
- }
-
- if (this._z != obj._z)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._x.GetHashCode();
- result = GenerateHash(result) ^ this._y.GetHashCode();
- result = GenerateHash(result) ^ this._z.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/AntennaLocation.cs b/tests/OpenDisNet.Reference/Generated/AntennaLocation.cs
deleted file mode 100644
index 295c55f..0000000
--- a/tests/OpenDisNet.Reference/Generated/AntennaLocation.cs
+++ /dev/null
@@ -1,315 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Location of the radiating portion of the antenna, specified in world coordinates and entity coordinates. Section 6.2.8
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(Vector3Double))]
- [XmlInclude(typeof(Vector3Float))]
- public partial class AntennaLocation
- {
- ///
- /// Location of the radiating portion of the antenna in world coordinates
- ///
- private Vector3Double _antennaLocation = new Vector3Double();
-
- ///
- /// Location of the radiating portion of the antenna in entity coordinates
- ///
- private Vector3Float _relativeAntennaLocation = new Vector3Float();
-
- ///
- /// Initializes a new instance of the class.
- ///
- public AntennaLocation()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(AntennaLocation left, AntennaLocation right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(AntennaLocation left, AntennaLocation right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += this._antennaLocation.GetMarshalledSize(); // this._antennaLocation
- marshalSize += this._relativeAntennaLocation.GetMarshalledSize(); // this._relativeAntennaLocation
- return marshalSize;
- }
-
- ///
- /// Gets or sets the Location of the radiating portion of the antenna in world coordinates
- ///
- [XmlElement(Type = typeof(Vector3Double), ElementName = "antennaLocation")]
- public Vector3Double AntennaLocation_
- {
- get
- {
- return this._antennaLocation;
- }
-
- set
- {
- this._antennaLocation = value;
- }
- }
-
- ///
- /// Gets or sets the Location of the radiating portion of the antenna in entity coordinates
- ///
- [XmlElement(Type = typeof(Vector3Float), ElementName = "relativeAntennaLocation")]
- public Vector3Float RelativeAntennaLocation
- {
- get
- {
- return this._relativeAntennaLocation;
- }
-
- set
- {
- this._relativeAntennaLocation = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- this._antennaLocation.Marshal(dos);
- this._relativeAntennaLocation.Marshal(dos);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._antennaLocation.Unmarshal(dis);
- this._relativeAntennaLocation.Unmarshal(dis);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("");
- this._antennaLocation.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- this._relativeAntennaLocation.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as AntennaLocation;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(AntennaLocation obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (!this._antennaLocation.Equals(obj._antennaLocation))
- {
- ivarsEqual = false;
- }
-
- if (!this._relativeAntennaLocation.Equals(obj._relativeAntennaLocation))
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._antennaLocation.GetHashCode();
- result = GenerateHash(result) ^ this._relativeAntennaLocation.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/ArealObjectStatePdu.cs b/tests/OpenDisNet.Reference/Generated/ArealObjectStatePdu.cs
deleted file mode 100644
index 5745e61..0000000
--- a/tests/OpenDisNet.Reference/Generated/ArealObjectStatePdu.cs
+++ /dev/null
@@ -1,685 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Information about the addition/modification of an oobject that is geometrically anchored to the terrain with a set of three or more points that come to a closure. Section 7.10.6 COMPLETE
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(EntityID))]
- [XmlInclude(typeof(EntityType))]
- [XmlInclude(typeof(SimulationAddress))]
- [XmlInclude(typeof(Vector3Double))]
- public partial class ArealObjectStatePdu : SyntheticEnvironmentFamilyPdu, IEquatable
- {
- ///
- /// Object in synthetic environment
- ///
- private EntityID _objectID = new EntityID();
-
- ///
- /// Object with which this point object is associated
- ///
- private EntityID _referencedObjectID = new EntityID();
-
- ///
- /// unique update number of each state transition of an object
- ///
- private ushort _updateNumber;
-
- ///
- /// force ID
- ///
- private byte _forceID;
-
- ///
- /// modifications enumeration
- ///
- private byte _modifications;
-
- ///
- /// Object type
- ///
- private EntityType _objectType = new EntityType();
-
- ///
- /// Object appearance
- ///
- private uint _specificObjectAppearance;
-
- ///
- /// Object appearance
- ///
- private ushort _generalObjectAppearance;
-
- ///
- /// Number of points
- ///
- private ushort _numberOfPoints;
-
- ///
- /// requesterID
- ///
- private SimulationAddress _requesterID = new SimulationAddress();
-
- ///
- /// receiver ID
- ///
- private SimulationAddress _receivingID = new SimulationAddress();
-
- ///
- /// location of object
- ///
- private List _objectLocation = new List();
-
- ///
- /// Initializes a new instance of the class.
- ///
- public ArealObjectStatePdu()
- {
- PduType = (byte)45;
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(ArealObjectStatePdu left, ArealObjectStatePdu right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(ArealObjectStatePdu left, ArealObjectStatePdu right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public override int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize = base.GetMarshalledSize();
- marshalSize += this._objectID.GetMarshalledSize(); // this._objectID
- marshalSize += this._referencedObjectID.GetMarshalledSize(); // this._referencedObjectID
- marshalSize += 2; // this._updateNumber
- marshalSize += 1; // this._forceID
- marshalSize += 1; // this._modifications
- marshalSize += this._objectType.GetMarshalledSize(); // this._objectType
- marshalSize += 4; // this._specificObjectAppearance
- marshalSize += 2; // this._generalObjectAppearance
- marshalSize += 2; // this._numberOfPoints
- marshalSize += this._requesterID.GetMarshalledSize(); // this._requesterID
- marshalSize += this._receivingID.GetMarshalledSize(); // this._receivingID
- for (int idx = 0; idx < this._objectLocation.Count; idx++)
- {
- Vector3Double listElement = (Vector3Double)this._objectLocation[idx];
- marshalSize += listElement.GetMarshalledSize();
- }
-
- return marshalSize;
- }
-
- ///
- /// Gets or sets the Object in synthetic environment
- ///
- [XmlElement(Type = typeof(EntityID), ElementName = "objectID")]
- public EntityID ObjectID
- {
- get
- {
- return this._objectID;
- }
-
- set
- {
- this._objectID = value;
- }
- }
-
- ///
- /// Gets or sets the Object with which this point object is associated
- ///
- [XmlElement(Type = typeof(EntityID), ElementName = "referencedObjectID")]
- public EntityID ReferencedObjectID
- {
- get
- {
- return this._referencedObjectID;
- }
-
- set
- {
- this._referencedObjectID = value;
- }
- }
-
- ///
- /// Gets or sets the unique update number of each state transition of an object
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "updateNumber")]
- public ushort UpdateNumber
- {
- get
- {
- return this._updateNumber;
- }
-
- set
- {
- this._updateNumber = value;
- }
- }
-
- ///
- /// Gets or sets the force ID
- ///
- [XmlElement(Type = typeof(byte), ElementName = "forceID")]
- public byte ForceID
- {
- get
- {
- return this._forceID;
- }
-
- set
- {
- this._forceID = value;
- }
- }
-
- ///
- /// Gets or sets the modifications enumeration
- ///
- [XmlElement(Type = typeof(byte), ElementName = "modifications")]
- public byte Modifications
- {
- get
- {
- return this._modifications;
- }
-
- set
- {
- this._modifications = value;
- }
- }
-
- ///
- /// Gets or sets the Object type
- ///
- [XmlElement(Type = typeof(EntityType), ElementName = "objectType")]
- public EntityType ObjectType
- {
- get
- {
- return this._objectType;
- }
-
- set
- {
- this._objectType = value;
- }
- }
-
- ///
- /// Gets or sets the Object appearance
- ///
- [XmlElement(Type = typeof(uint), ElementName = "specificObjectAppearance")]
- public uint SpecificObjectAppearance
- {
- get
- {
- return this._specificObjectAppearance;
- }
-
- set
- {
- this._specificObjectAppearance = value;
- }
- }
-
- ///
- /// Gets or sets the Object appearance
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "generalObjectAppearance")]
- public ushort GeneralObjectAppearance
- {
- get
- {
- return this._generalObjectAppearance;
- }
-
- set
- {
- this._generalObjectAppearance = value;
- }
- }
-
- ///
- /// Note that setting this value will not change the marshalled value. The list whose length this describes is used for that purpose.
- /// The getnumberOfPoints method will also be based on the actual list length rather than this value.
- /// The method is simply here for completeness and should not be used for any computations.
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "numberOfPoints")]
- public ushort NumberOfPoints
- {
- get
- {
- return this._numberOfPoints;
- }
-
- set
- {
- this._numberOfPoints = value;
- }
- }
-
- ///
- /// Gets or sets the requesterID
- ///
- [XmlElement(Type = typeof(SimulationAddress), ElementName = "requesterID")]
- public SimulationAddress RequesterID
- {
- get
- {
- return this._requesterID;
- }
-
- set
- {
- this._requesterID = value;
- }
- }
-
- ///
- /// Gets or sets the receiver ID
- ///
- [XmlElement(Type = typeof(SimulationAddress), ElementName = "receivingID")]
- public SimulationAddress ReceivingID
- {
- get
- {
- return this._receivingID;
- }
-
- set
- {
- this._receivingID = value;
- }
- }
-
- ///
- /// Gets or sets the location of object
- ///
- [XmlElement(ElementName = "objectLocationList", Type = typeof(List))]
- public List ObjectLocation
- {
- get
- {
- return this._objectLocation;
- }
- }
-
- ///
- /// Automatically sets the length of the marshalled data, then calls the marshal method.
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- public override void MarshalAutoLengthSet(DataOutputStream dos)
- {
- // Set the length prior to marshalling data
- this.Length = (ushort)this.GetMarshalledSize();
- this.Marshal(dos);
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Marshal(DataOutputStream dos)
- {
- base.Marshal(dos);
- if (dos != null)
- {
- try
- {
- this._objectID.Marshal(dos);
- this._referencedObjectID.Marshal(dos);
- dos.WriteUnsignedShort((ushort)this._updateNumber);
- dos.WriteUnsignedByte((byte)this._forceID);
- dos.WriteUnsignedByte((byte)this._modifications);
- this._objectType.Marshal(dos);
- dos.WriteUnsignedInt((uint)this._specificObjectAppearance);
- dos.WriteUnsignedShort((ushort)this._generalObjectAppearance);
- dos.WriteUnsignedShort((ushort)this._objectLocation.Count);
- this._requesterID.Marshal(dos);
- this._receivingID.Marshal(dos);
-
- for (int idx = 0; idx < this._objectLocation.Count; idx++)
- {
- Vector3Double aVector3Double = (Vector3Double)this._objectLocation[idx];
- aVector3Double.Marshal(dos);
- }
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Unmarshal(DataInputStream dis)
- {
- base.Unmarshal(dis);
-
- if (dis != null)
- {
- try
- {
- this._objectID.Unmarshal(dis);
- this._referencedObjectID.Unmarshal(dis);
- this._updateNumber = dis.ReadUnsignedShort();
- this._forceID = dis.ReadUnsignedByte();
- this._modifications = dis.ReadUnsignedByte();
- this._objectType.Unmarshal(dis);
- this._specificObjectAppearance = dis.ReadUnsignedInt();
- this._generalObjectAppearance = dis.ReadUnsignedShort();
- this._numberOfPoints = dis.ReadUnsignedShort();
- this._requesterID.Unmarshal(dis);
- this._receivingID.Unmarshal(dis);
- for (int idx = 0; idx < this.NumberOfPoints; idx++)
- {
- Vector3Double anX = new Vector3Double();
- anX.Unmarshal(dis);
- this._objectLocation.Add(anX);
- };
-
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- base.Reflection(sb);
- try
- {
- sb.AppendLine("");
- this._objectID.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- this._referencedObjectID.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._updateNumber.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._forceID.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._modifications.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- this._objectType.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._specificObjectAppearance.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._generalObjectAppearance.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._objectLocation.Count.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- this._requesterID.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- this._receivingID.Reflection(sb);
- sb.AppendLine("");
- for (int idx = 0; idx < this._objectLocation.Count; idx++)
- {
- sb.AppendLine("");
- Vector3Double aVector3Double = (Vector3Double)this._objectLocation[idx];
- aVector3Double.Reflection(sb);
- sb.AppendLine("");
- }
-
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as ArealObjectStatePdu;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(ArealObjectStatePdu obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- ivarsEqual = base.Equals(obj);
-
- if (!this._objectID.Equals(obj._objectID))
- {
- ivarsEqual = false;
- }
-
- if (!this._referencedObjectID.Equals(obj._referencedObjectID))
- {
- ivarsEqual = false;
- }
-
- if (this._updateNumber != obj._updateNumber)
- {
- ivarsEqual = false;
- }
-
- if (this._forceID != obj._forceID)
- {
- ivarsEqual = false;
- }
-
- if (this._modifications != obj._modifications)
- {
- ivarsEqual = false;
- }
-
- if (!this._objectType.Equals(obj._objectType))
- {
- ivarsEqual = false;
- }
-
- if (this._specificObjectAppearance != obj._specificObjectAppearance)
- {
- ivarsEqual = false;
- }
-
- if (this._generalObjectAppearance != obj._generalObjectAppearance)
- {
- ivarsEqual = false;
- }
-
- if (this._numberOfPoints != obj._numberOfPoints)
- {
- ivarsEqual = false;
- }
-
- if (!this._requesterID.Equals(obj._requesterID))
- {
- ivarsEqual = false;
- }
-
- if (!this._receivingID.Equals(obj._receivingID))
- {
- ivarsEqual = false;
- }
-
- if (this._objectLocation.Count != obj._objectLocation.Count)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < this._objectLocation.Count; idx++)
- {
- if (!this._objectLocation[idx].Equals(obj._objectLocation[idx]))
- {
- ivarsEqual = false;
- }
- }
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ base.GetHashCode();
-
- result = GenerateHash(result) ^ this._objectID.GetHashCode();
- result = GenerateHash(result) ^ this._referencedObjectID.GetHashCode();
- result = GenerateHash(result) ^ this._updateNumber.GetHashCode();
- result = GenerateHash(result) ^ this._forceID.GetHashCode();
- result = GenerateHash(result) ^ this._modifications.GetHashCode();
- result = GenerateHash(result) ^ this._objectType.GetHashCode();
- result = GenerateHash(result) ^ this._specificObjectAppearance.GetHashCode();
- result = GenerateHash(result) ^ this._generalObjectAppearance.GetHashCode();
- result = GenerateHash(result) ^ this._numberOfPoints.GetHashCode();
- result = GenerateHash(result) ^ this._requesterID.GetHashCode();
- result = GenerateHash(result) ^ this._receivingID.GetHashCode();
-
- if (this._objectLocation.Count > 0)
- {
- for (int idx = 0; idx < this._objectLocation.Count; idx++)
- {
- result = GenerateHash(result) ^ this._objectLocation[idx].GetHashCode();
- }
- }
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/ArticulatedParts.cs b/tests/OpenDisNet.Reference/Generated/ArticulatedParts.cs
deleted file mode 100644
index 2276f66..0000000
--- a/tests/OpenDisNet.Reference/Generated/ArticulatedParts.cs
+++ /dev/null
@@ -1,405 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// articulated parts for movable parts and a combination of moveable/attached parts of an entity. Section 6.2.93.2
- ///
- [Serializable]
- [XmlRoot]
- public partial class ArticulatedParts
- {
- ///
- /// the identification of the Variable Parameter record. Enumeration from EBV
- ///
- private byte _recordType;
-
- ///
- /// indicate the change of any parameter for any articulated part. Starts at zero, incremented for each change
- ///
- private byte _changeIndicator;
-
- ///
- /// the identification of the articulated part to which this articulation parameter is attached. This field shall be specified by a 16-bit unsigned integer. This field shall contain the value zero if the articulated part is attached directly to the entity.
- ///
- private ushort _partAttachedTo;
-
- ///
- /// the type of parameter represented, 32 bit enumeration
- ///
- private uint _parameterType;
-
- ///
- /// The definition of the 64 bits shall be determined based on the type of parameter specified in the Parameter Type field
- ///
- private ulong _parameterValue;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public ArticulatedParts()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(ArticulatedParts left, ArticulatedParts right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(ArticulatedParts left, ArticulatedParts right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += 1; // this._recordType
- marshalSize += 1; // this._changeIndicator
- marshalSize += 2; // this._partAttachedTo
- marshalSize += 4; // this._parameterType
- marshalSize += 8; // this._parameterValue
- return marshalSize;
- }
-
- ///
- /// Gets or sets the the identification of the Variable Parameter record. Enumeration from EBV
- ///
- [XmlElement(Type = typeof(byte), ElementName = "recordType")]
- public byte RecordType
- {
- get
- {
- return this._recordType;
- }
-
- set
- {
- this._recordType = value;
- }
- }
-
- ///
- /// Gets or sets the indicate the change of any parameter for any articulated part. Starts at zero, incremented for each change
- ///
- [XmlElement(Type = typeof(byte), ElementName = "changeIndicator")]
- public byte ChangeIndicator
- {
- get
- {
- return this._changeIndicator;
- }
-
- set
- {
- this._changeIndicator = value;
- }
- }
-
- ///
- /// Gets or sets the the identification of the articulated part to which this articulation parameter is attached. This field shall be specified by a 16-bit unsigned integer. This field shall contain the value zero if the articulated part is attached directly to the entity.
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "partAttachedTo")]
- public ushort PartAttachedTo
- {
- get
- {
- return this._partAttachedTo;
- }
-
- set
- {
- this._partAttachedTo = value;
- }
- }
-
- ///
- /// Gets or sets the the type of parameter represented, 32 bit enumeration
- ///
- [XmlElement(Type = typeof(uint), ElementName = "parameterType")]
- public uint ParameterType
- {
- get
- {
- return this._parameterType;
- }
-
- set
- {
- this._parameterType = value;
- }
- }
-
- ///
- /// Gets or sets the The definition of the 64 bits shall be determined based on the type of parameter specified in the Parameter Type field
- ///
- [XmlElement(Type = typeof(ulong), ElementName = "parameterValue")]
- public ulong ParameterValue
- {
- get
- {
- return this._parameterValue;
- }
-
- set
- {
- this._parameterValue = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedByte((byte)this._recordType);
- dos.WriteUnsignedByte((byte)this._changeIndicator);
- dos.WriteUnsignedShort((ushort)this._partAttachedTo);
- dos.WriteUnsignedInt((uint)this._parameterType);
- dos.WriteUnsignedLong((ulong)this._parameterValue);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._recordType = dis.ReadUnsignedByte();
- this._changeIndicator = dis.ReadUnsignedByte();
- this._partAttachedTo = dis.ReadUnsignedShort();
- this._parameterType = dis.ReadUnsignedInt();
- this._parameterValue = dis.ReadUnsignedLong();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("" + this._recordType.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._changeIndicator.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._partAttachedTo.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._parameterType.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._parameterValue.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as ArticulatedParts;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(ArticulatedParts obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (this._recordType != obj._recordType)
- {
- ivarsEqual = false;
- }
-
- if (this._changeIndicator != obj._changeIndicator)
- {
- ivarsEqual = false;
- }
-
- if (this._partAttachedTo != obj._partAttachedTo)
- {
- ivarsEqual = false;
- }
-
- if (this._parameterType != obj._parameterType)
- {
- ivarsEqual = false;
- }
-
- if (this._parameterValue != obj._parameterValue)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._recordType.GetHashCode();
- result = GenerateHash(result) ^ this._changeIndicator.GetHashCode();
- result = GenerateHash(result) ^ this._partAttachedTo.GetHashCode();
- result = GenerateHash(result) ^ this._parameterType.GetHashCode();
- result = GenerateHash(result) ^ this._parameterValue.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/Association.cs b/tests/OpenDisNet.Reference/Generated/Association.cs
deleted file mode 100644
index 9e03f80..0000000
--- a/tests/OpenDisNet.Reference/Generated/Association.cs
+++ /dev/null
@@ -1,367 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// An entity's associations with other entities and/or locations. For each association, this record shall specify the type of the association, the associated entity's EntityID and/or the associated location's world coordinates. This record may be used (optionally) in a transfer transaction to send internal state data from the divesting simulation to the acquiring simulation (see 5.9.4). This record may also be used for other purposes. Section 6.2.10
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(EntityID))]
- [XmlInclude(typeof(Vector3Double))]
- public partial class Association
- {
- private byte _associationType;
-
- private byte _padding4;
-
- ///
- /// identity of associated entity. If none, NO_SPECIFIC_ENTITY
- ///
- private EntityID _associatedEntityID = new EntityID();
-
- ///
- /// location, in world coordinates
- ///
- private Vector3Double _associatedLocation = new Vector3Double();
-
- ///
- /// Initializes a new instance of the class.
- ///
- public Association()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(Association left, Association right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(Association left, Association right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += 1; // this._associationType
- marshalSize += 1; // this._padding4
- marshalSize += this._associatedEntityID.GetMarshalledSize(); // this._associatedEntityID
- marshalSize += this._associatedLocation.GetMarshalledSize(); // this._associatedLocation
- return marshalSize;
- }
-
- [XmlElement(Type = typeof(byte), ElementName = "associationType")]
- public byte AssociationType
- {
- get
- {
- return this._associationType;
- }
-
- set
- {
- this._associationType = value;
- }
- }
-
- [XmlElement(Type = typeof(byte), ElementName = "padding4")]
- public byte Padding4
- {
- get
- {
- return this._padding4;
- }
-
- set
- {
- this._padding4 = value;
- }
- }
-
- ///
- /// Gets or sets the identity of associated entity. If none, NO_SPECIFIC_ENTITY
- ///
- [XmlElement(Type = typeof(EntityID), ElementName = "associatedEntityID")]
- public EntityID AssociatedEntityID
- {
- get
- {
- return this._associatedEntityID;
- }
-
- set
- {
- this._associatedEntityID = value;
- }
- }
-
- ///
- /// Gets or sets the location, in world coordinates
- ///
- [XmlElement(Type = typeof(Vector3Double), ElementName = "associatedLocation")]
- public Vector3Double AssociatedLocation
- {
- get
- {
- return this._associatedLocation;
- }
-
- set
- {
- this._associatedLocation = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedByte((byte)this._associationType);
- dos.WriteUnsignedByte((byte)this._padding4);
- this._associatedEntityID.Marshal(dos);
- this._associatedLocation.Marshal(dos);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._associationType = dis.ReadUnsignedByte();
- this._padding4 = dis.ReadUnsignedByte();
- this._associatedEntityID.Unmarshal(dis);
- this._associatedLocation.Unmarshal(dis);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("" + this._associationType.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._padding4.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- this._associatedEntityID.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- this._associatedLocation.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as Association;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(Association obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (this._associationType != obj._associationType)
- {
- ivarsEqual = false;
- }
-
- if (this._padding4 != obj._padding4)
- {
- ivarsEqual = false;
- }
-
- if (!this._associatedEntityID.Equals(obj._associatedEntityID))
- {
- ivarsEqual = false;
- }
-
- if (!this._associatedLocation.Equals(obj._associatedLocation))
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._associationType.GetHashCode();
- result = GenerateHash(result) ^ this._padding4.GetHashCode();
- result = GenerateHash(result) ^ this._associatedEntityID.GetHashCode();
- result = GenerateHash(result) ^ this._associatedLocation.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/AttachedParts.cs b/tests/OpenDisNet.Reference/Generated/AttachedParts.cs
deleted file mode 100644
index 3e41b87..0000000
--- a/tests/OpenDisNet.Reference/Generated/AttachedParts.cs
+++ /dev/null
@@ -1,405 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Removable parts that may be attached to an entity. Section 6.2.93.3
- ///
- [Serializable]
- [XmlRoot]
- public partial class AttachedParts
- {
- ///
- /// the identification of the Variable Parameter record. Enumeration from EBV
- ///
- private byte _recordType = 1;
-
- ///
- /// 0 = attached, 1 = detached. See I.2.3.1 for state transition diagram
- ///
- private byte _detachedIndicator;
-
- ///
- /// the identification of the articulated part to which this articulation parameter is attached. This field shall be specified by a 16-bit unsigned integer. This field shall contain the value zero if the articulated part is attached directly to the entity.
- ///
- private ushort _partAttachedTo;
-
- ///
- /// The location or station to which the part is attached
- ///
- private uint _parameterType;
-
- ///
- /// The definition of the 64 bits shall be determined based on the type of parameter specified in the Parameter Type field
- ///
- private ulong _parameterValue;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public AttachedParts()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(AttachedParts left, AttachedParts right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(AttachedParts left, AttachedParts right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += 1; // this._recordType
- marshalSize += 1; // this._detachedIndicator
- marshalSize += 2; // this._partAttachedTo
- marshalSize += 4; // this._parameterType
- marshalSize += 8; // this._parameterValue
- return marshalSize;
- }
-
- ///
- /// Gets or sets the the identification of the Variable Parameter record. Enumeration from EBV
- ///
- [XmlElement(Type = typeof(byte), ElementName = "recordType")]
- public byte RecordType
- {
- get
- {
- return this._recordType;
- }
-
- set
- {
- this._recordType = value;
- }
- }
-
- ///
- /// Gets or sets the 0 = attached, 1 = detached. See I.2.3.1 for state transition diagram
- ///
- [XmlElement(Type = typeof(byte), ElementName = "detachedIndicator")]
- public byte DetachedIndicator
- {
- get
- {
- return this._detachedIndicator;
- }
-
- set
- {
- this._detachedIndicator = value;
- }
- }
-
- ///
- /// Gets or sets the the identification of the articulated part to which this articulation parameter is attached. This field shall be specified by a 16-bit unsigned integer. This field shall contain the value zero if the articulated part is attached directly to the entity.
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "partAttachedTo")]
- public ushort PartAttachedTo
- {
- get
- {
- return this._partAttachedTo;
- }
-
- set
- {
- this._partAttachedTo = value;
- }
- }
-
- ///
- /// Gets or sets the The location or station to which the part is attached
- ///
- [XmlElement(Type = typeof(uint), ElementName = "parameterType")]
- public uint ParameterType
- {
- get
- {
- return this._parameterType;
- }
-
- set
- {
- this._parameterType = value;
- }
- }
-
- ///
- /// Gets or sets the The definition of the 64 bits shall be determined based on the type of parameter specified in the Parameter Type field
- ///
- [XmlElement(Type = typeof(ulong), ElementName = "parameterValue")]
- public ulong ParameterValue
- {
- get
- {
- return this._parameterValue;
- }
-
- set
- {
- this._parameterValue = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedByte((byte)this._recordType);
- dos.WriteUnsignedByte((byte)this._detachedIndicator);
- dos.WriteUnsignedShort((ushort)this._partAttachedTo);
- dos.WriteUnsignedInt((uint)this._parameterType);
- dos.WriteUnsignedLong((ulong)this._parameterValue);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._recordType = dis.ReadUnsignedByte();
- this._detachedIndicator = dis.ReadUnsignedByte();
- this._partAttachedTo = dis.ReadUnsignedShort();
- this._parameterType = dis.ReadUnsignedInt();
- this._parameterValue = dis.ReadUnsignedLong();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("" + this._recordType.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._detachedIndicator.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._partAttachedTo.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._parameterType.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._parameterValue.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as AttachedParts;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(AttachedParts obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (this._recordType != obj._recordType)
- {
- ivarsEqual = false;
- }
-
- if (this._detachedIndicator != obj._detachedIndicator)
- {
- ivarsEqual = false;
- }
-
- if (this._partAttachedTo != obj._partAttachedTo)
- {
- ivarsEqual = false;
- }
-
- if (this._parameterType != obj._parameterType)
- {
- ivarsEqual = false;
- }
-
- if (this._parameterValue != obj._parameterValue)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._recordType.GetHashCode();
- result = GenerateHash(result) ^ this._detachedIndicator.GetHashCode();
- result = GenerateHash(result) ^ this._partAttachedTo.GetHashCode();
- result = GenerateHash(result) ^ this._parameterType.GetHashCode();
- result = GenerateHash(result) ^ this._parameterValue.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/Attribute.cs b/tests/OpenDisNet.Reference/Generated/Attribute.cs
deleted file mode 100644
index af8503c..0000000
--- a/tests/OpenDisNet.Reference/Generated/Attribute.cs
+++ /dev/null
@@ -1,323 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Used to convey information for one or more attributes. Attributes conform to the standard variable record format of 6.2.82. Section 6.2.11
- ///
- [Serializable]
- [XmlRoot]
- public partial class Attribute
- {
- private uint _recordType;
-
- private byte _recordLength;
-
- private ulong _recordSpecificFields;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public Attribute()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(Attribute left, Attribute right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(Attribute left, Attribute right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += 4; // this._recordType
- marshalSize += 1; // this._recordLength
- marshalSize += 8; // this._recordSpecificFields
- return marshalSize;
- }
-
- [XmlElement(Type = typeof(uint), ElementName = "recordType")]
- public uint RecordType
- {
- get
- {
- return this._recordType;
- }
-
- set
- {
- this._recordType = value;
- }
- }
-
- [XmlElement(Type = typeof(byte), ElementName = "recordLength")]
- public byte RecordLength
- {
- get
- {
- return this._recordLength;
- }
-
- set
- {
- this._recordLength = value;
- }
- }
-
- [XmlElement(Type = typeof(ulong), ElementName = "recordSpecificFields")]
- public ulong RecordSpecificFields
- {
- get
- {
- return this._recordSpecificFields;
- }
-
- set
- {
- this._recordSpecificFields = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedInt((uint)this._recordType);
- dos.WriteUnsignedByte((byte)this._recordLength);
- dos.WriteUnsignedLong((ulong)this._recordSpecificFields);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._recordType = dis.ReadUnsignedInt();
- this._recordLength = dis.ReadUnsignedByte();
- this._recordSpecificFields = dis.ReadUnsignedLong();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("" + this._recordType.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._recordLength.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._recordSpecificFields.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as Attribute;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(Attribute obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (this._recordType != obj._recordType)
- {
- ivarsEqual = false;
- }
-
- if (this._recordLength != obj._recordLength)
- {
- ivarsEqual = false;
- }
-
- if (this._recordSpecificFields != obj._recordSpecificFields)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._recordType.GetHashCode();
- result = GenerateHash(result) ^ this._recordLength.GetHashCode();
- result = GenerateHash(result) ^ this._recordSpecificFields.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/AttributePdu.cs b/tests/OpenDisNet.Reference/Generated/AttributePdu.cs
deleted file mode 100644
index 466a155..0000000
--- a/tests/OpenDisNet.Reference/Generated/AttributePdu.cs
+++ /dev/null
@@ -1,539 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Information about individual attributes for a particular entity, other object, or event may be communicated using an Attribute PDU. The Attribute PDU shall not be used to exchange data available in any other PDU except where explicitly mentioned in the PDU issuance instructions within this standard. See 5.3.6 for the information requirements and issuance and receipt rules for this PDU. Section 7.2.6. INCOMPLETE
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(SimulationAddress))]
- public partial class AttributePdu : EntityInformationFamilyPdu, IEquatable
- {
- ///
- /// This field shall identify the simulation issuing the Attribute PDU. It shall be represented by a Simulation Address record (see 6.2.79).
- ///
- private SimulationAddress _originatingSimulationAddress = new SimulationAddress();
-
- ///
- /// Padding
- ///
- private int _padding1;
-
- ///
- /// Padding
- ///
- private short _padding2;
-
- ///
- /// This field shall represent the type of the PDU that is being extended or updated, if applicable. It shall be represented by an 8-bit enumeration.
- ///
- private byte _attributeRecordPduType;
-
- ///
- /// This field shall indicate the Protocol Version associated with the Attribute Record PDU Type. It shall be represented by an 8-bit enumeration.
- ///
- private byte _attributeRecordProtocolVersion;
-
- ///
- /// This field shall contain the Attribute record type of the Attribute records in the PDU if they all have the same Attribute record type. It shall be represented by a 32-bit enumeration.
- ///
- private uint _masterAttributeRecordType;
-
- ///
- /// This field shall identify the action code applicable to this Attribute PDU. The Action Code shall apply to all Attribute records contained in the PDU. It shall be represented by an 8-bit enumeration.
- ///
- private byte _actionCode;
-
- ///
- /// Padding
- ///
- private byte _padding3;
-
- ///
- /// This field shall specify the number of Attribute Record Sets that make up the remainder of the PDU. It shall be represented by a 16-bit unsigned integer.
- ///
- private ushort _numberAttributeRecordSet;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public AttributePdu()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(AttributePdu left, AttributePdu right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(AttributePdu left, AttributePdu right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public override int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize = base.GetMarshalledSize();
- marshalSize += this._originatingSimulationAddress.GetMarshalledSize(); // this._originatingSimulationAddress
- marshalSize += 4; // this._padding1
- marshalSize += 2; // this._padding2
- marshalSize += 1; // this._attributeRecordPduType
- marshalSize += 1; // this._attributeRecordProtocolVersion
- marshalSize += 4; // this._masterAttributeRecordType
- marshalSize += 1; // this._actionCode
- marshalSize += 1; // this._padding3
- marshalSize += 2; // this._numberAttributeRecordSet
- return marshalSize;
- }
-
- ///
- /// Gets or sets the This field shall identify the simulation issuing the Attribute PDU. It shall be represented by a Simulation Address record (see 6.2.79).
- ///
- [XmlElement(Type = typeof(SimulationAddress), ElementName = "originatingSimulationAddress")]
- public SimulationAddress OriginatingSimulationAddress
- {
- get
- {
- return this._originatingSimulationAddress;
- }
-
- set
- {
- this._originatingSimulationAddress = value;
- }
- }
-
- ///
- /// Gets or sets the Padding
- ///
- [XmlElement(Type = typeof(int), ElementName = "padding1")]
- public int Padding1
- {
- get
- {
- return this._padding1;
- }
-
- set
- {
- this._padding1 = value;
- }
- }
-
- ///
- /// Gets or sets the Padding
- ///
- [XmlElement(Type = typeof(short), ElementName = "padding2")]
- public short Padding2
- {
- get
- {
- return this._padding2;
- }
-
- set
- {
- this._padding2 = value;
- }
- }
-
- ///
- /// Gets or sets the This field shall represent the type of the PDU that is being extended or updated, if applicable. It shall be represented by an 8-bit enumeration.
- ///
- [XmlElement(Type = typeof(byte), ElementName = "attributeRecordPduType")]
- public byte AttributeRecordPduType
- {
- get
- {
- return this._attributeRecordPduType;
- }
-
- set
- {
- this._attributeRecordPduType = value;
- }
- }
-
- ///
- /// Gets or sets the This field shall indicate the Protocol Version associated with the Attribute Record PDU Type. It shall be represented by an 8-bit enumeration.
- ///
- [XmlElement(Type = typeof(byte), ElementName = "attributeRecordProtocolVersion")]
- public byte AttributeRecordProtocolVersion
- {
- get
- {
- return this._attributeRecordProtocolVersion;
- }
-
- set
- {
- this._attributeRecordProtocolVersion = value;
- }
- }
-
- ///
- /// Gets or sets the This field shall contain the Attribute record type of the Attribute records in the PDU if they all have the same Attribute record type. It shall be represented by a 32-bit enumeration.
- ///
- [XmlElement(Type = typeof(uint), ElementName = "masterAttributeRecordType")]
- public uint MasterAttributeRecordType
- {
- get
- {
- return this._masterAttributeRecordType;
- }
-
- set
- {
- this._masterAttributeRecordType = value;
- }
- }
-
- ///
- /// Gets or sets the This field shall identify the action code applicable to this Attribute PDU. The Action Code shall apply to all Attribute records contained in the PDU. It shall be represented by an 8-bit enumeration.
- ///
- [XmlElement(Type = typeof(byte), ElementName = "actionCode")]
- public byte ActionCode
- {
- get
- {
- return this._actionCode;
- }
-
- set
- {
- this._actionCode = value;
- }
- }
-
- ///
- /// Gets or sets the Padding
- ///
- [XmlElement(Type = typeof(byte), ElementName = "padding3")]
- public byte Padding3
- {
- get
- {
- return this._padding3;
- }
-
- set
- {
- this._padding3 = value;
- }
- }
-
- ///
- /// Gets or sets the This field shall specify the number of Attribute Record Sets that make up the remainder of the PDU. It shall be represented by a 16-bit unsigned integer.
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "numberAttributeRecordSet")]
- public ushort NumberAttributeRecordSet
- {
- get
- {
- return this._numberAttributeRecordSet;
- }
-
- set
- {
- this._numberAttributeRecordSet = value;
- }
- }
-
- ///
- /// Automatically sets the length of the marshalled data, then calls the marshal method.
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- public override void MarshalAutoLengthSet(DataOutputStream dos)
- {
- // Set the length prior to marshalling data
- this.Length = (ushort)this.GetMarshalledSize();
- this.Marshal(dos);
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Marshal(DataOutputStream dos)
- {
- base.Marshal(dos);
- if (dos != null)
- {
- try
- {
- this._originatingSimulationAddress.Marshal(dos);
- dos.WriteInt((int)this._padding1);
- dos.WriteShort((short)this._padding2);
- dos.WriteUnsignedByte((byte)this._attributeRecordPduType);
- dos.WriteUnsignedByte((byte)this._attributeRecordProtocolVersion);
- dos.WriteUnsignedInt((uint)this._masterAttributeRecordType);
- dos.WriteUnsignedByte((byte)this._actionCode);
- dos.WriteByte((byte)this._padding3);
- dos.WriteUnsignedShort((ushort)this._numberAttributeRecordSet);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Unmarshal(DataInputStream dis)
- {
- base.Unmarshal(dis);
-
- if (dis != null)
- {
- try
- {
- this._originatingSimulationAddress.Unmarshal(dis);
- this._padding1 = dis.ReadInt();
- this._padding2 = dis.ReadShort();
- this._attributeRecordPduType = dis.ReadUnsignedByte();
- this._attributeRecordProtocolVersion = dis.ReadUnsignedByte();
- this._masterAttributeRecordType = dis.ReadUnsignedInt();
- this._actionCode = dis.ReadUnsignedByte();
- this._padding3 = dis.ReadByte();
- this._numberAttributeRecordSet = dis.ReadUnsignedShort();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- base.Reflection(sb);
- try
- {
- sb.AppendLine("");
- this._originatingSimulationAddress.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._padding1.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._padding2.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._attributeRecordPduType.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._attributeRecordProtocolVersion.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._masterAttributeRecordType.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._actionCode.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._padding3.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._numberAttributeRecordSet.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as AttributePdu;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(AttributePdu obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- ivarsEqual = base.Equals(obj);
-
- if (!this._originatingSimulationAddress.Equals(obj._originatingSimulationAddress))
- {
- ivarsEqual = false;
- }
-
- if (this._padding1 != obj._padding1)
- {
- ivarsEqual = false;
- }
-
- if (this._padding2 != obj._padding2)
- {
- ivarsEqual = false;
- }
-
- if (this._attributeRecordPduType != obj._attributeRecordPduType)
- {
- ivarsEqual = false;
- }
-
- if (this._attributeRecordProtocolVersion != obj._attributeRecordProtocolVersion)
- {
- ivarsEqual = false;
- }
-
- if (this._masterAttributeRecordType != obj._masterAttributeRecordType)
- {
- ivarsEqual = false;
- }
-
- if (this._actionCode != obj._actionCode)
- {
- ivarsEqual = false;
- }
-
- if (this._padding3 != obj._padding3)
- {
- ivarsEqual = false;
- }
-
- if (this._numberAttributeRecordSet != obj._numberAttributeRecordSet)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ base.GetHashCode();
-
- result = GenerateHash(result) ^ this._originatingSimulationAddress.GetHashCode();
- result = GenerateHash(result) ^ this._padding1.GetHashCode();
- result = GenerateHash(result) ^ this._padding2.GetHashCode();
- result = GenerateHash(result) ^ this._attributeRecordPduType.GetHashCode();
- result = GenerateHash(result) ^ this._attributeRecordProtocolVersion.GetHashCode();
- result = GenerateHash(result) ^ this._masterAttributeRecordType.GetHashCode();
- result = GenerateHash(result) ^ this._actionCode.GetHashCode();
- result = GenerateHash(result) ^ this._padding3.GetHashCode();
- result = GenerateHash(result) ^ this._numberAttributeRecordSet.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/BeamAntennaPattern.cs b/tests/OpenDisNet.Reference/Generated/BeamAntennaPattern.cs
deleted file mode 100644
index 32707ad..0000000
--- a/tests/OpenDisNet.Reference/Generated/BeamAntennaPattern.cs
+++ /dev/null
@@ -1,538 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Used when the antenna pattern type field has a value of 1. Specifies the direction, pattern, and polarization of radiation from an antenna. Section 6.2.9.2
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(EulerAngles))]
- public partial class BeamAntennaPattern
- {
- ///
- /// The rotation that transforms the reference coordinate sytem into the beam coordinate system. Either world coordinates or entity coordinates may be used as the reference coordinate system, as specified by the reference system field of the antenna pattern record.
- ///
- private EulerAngles _beamDirection = new EulerAngles();
-
- private float _azimuthBeamwidth;
-
- private float _elevationBeamwidth;
-
- private float _referenceSystem;
-
- private byte _padding1;
-
- private ushort _padding2;
-
- ///
- /// This field shall specify the magnitude of the Z-component (in beam coordinates) of the Electrical field at some arbitrary single point in the main beam and in the far field of the antenna.
- ///
- private float _ez = 0.0F;
-
- ///
- /// This field shall specify the magnitude of the X-component (in beam coordinates) of the Electri- cal field at some arbitrary single point in the main beam and in the far field of the antenna.
- ///
- private float _ex = 0.0F;
-
- ///
- /// This field shall specify the phase angle between EZ and EX in radians. If fully omni-direc- tional antenna is modeled using beam pattern type one, the omni-directional antenna shall be repre- sented by beam direction Euler angles psi, theta, and phi of zero, an azimuth beamwidth of 2PI, and an elevation beamwidth of PI
- ///
- private float _phase = 0.0F;
-
- ///
- /// padding
- ///
- private uint _padding3;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public BeamAntennaPattern()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(BeamAntennaPattern left, BeamAntennaPattern right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(BeamAntennaPattern left, BeamAntennaPattern right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += this._beamDirection.GetMarshalledSize(); // this._beamDirection
- marshalSize += 4; // this._azimuthBeamwidth
- marshalSize += 4; // this._elevationBeamwidth
- marshalSize += 4; // this._referenceSystem
- marshalSize += 1; // this._padding1
- marshalSize += 2; // this._padding2
- marshalSize += 4; // this._ez
- marshalSize += 4; // this._ex
- marshalSize += 4; // this._phase
- marshalSize += 4; // this._padding3
- return marshalSize;
- }
-
- ///
- /// Gets or sets the The rotation that transforms the reference coordinate sytem into the beam coordinate system. Either world coordinates or entity coordinates may be used as the reference coordinate system, as specified by the reference system field of the antenna pattern record.
- ///
- [XmlElement(Type = typeof(EulerAngles), ElementName = "beamDirection")]
- public EulerAngles BeamDirection
- {
- get
- {
- return this._beamDirection;
- }
-
- set
- {
- this._beamDirection = value;
- }
- }
-
- [XmlElement(Type = typeof(float), ElementName = "azimuthBeamwidth")]
- public float AzimuthBeamwidth
- {
- get
- {
- return this._azimuthBeamwidth;
- }
-
- set
- {
- this._azimuthBeamwidth = value;
- }
- }
-
- [XmlElement(Type = typeof(float), ElementName = "elevationBeamwidth")]
- public float ElevationBeamwidth
- {
- get
- {
- return this._elevationBeamwidth;
- }
-
- set
- {
- this._elevationBeamwidth = value;
- }
- }
-
- [XmlElement(Type = typeof(float), ElementName = "referenceSystem")]
- public float ReferenceSystem
- {
- get
- {
- return this._referenceSystem;
- }
-
- set
- {
- this._referenceSystem = value;
- }
- }
-
- [XmlElement(Type = typeof(byte), ElementName = "padding1")]
- public byte Padding1
- {
- get
- {
- return this._padding1;
- }
-
- set
- {
- this._padding1 = value;
- }
- }
-
- [XmlElement(Type = typeof(ushort), ElementName = "padding2")]
- public ushort Padding2
- {
- get
- {
- return this._padding2;
- }
-
- set
- {
- this._padding2 = value;
- }
- }
-
- ///
- /// Gets or sets the This field shall specify the magnitude of the Z-component (in beam coordinates) of the Electrical field at some arbitrary single point in the main beam and in the far field of the antenna.
- ///
- [XmlElement(Type = typeof(float), ElementName = "ez")]
- public float Ez
- {
- get
- {
- return this._ez;
- }
-
- set
- {
- this._ez = value;
- }
- }
-
- ///
- /// Gets or sets the This field shall specify the magnitude of the X-component (in beam coordinates) of the Electri- cal field at some arbitrary single point in the main beam and in the far field of the antenna.
- ///
- [XmlElement(Type = typeof(float), ElementName = "ex")]
- public float Ex
- {
- get
- {
- return this._ex;
- }
-
- set
- {
- this._ex = value;
- }
- }
-
- ///
- /// Gets or sets the This field shall specify the phase angle between EZ and EX in radians. If fully omni-direc- tional antenna is modeled using beam pattern type one, the omni-directional antenna shall be repre- sented by beam direction Euler angles psi, theta, and phi of zero, an azimuth beamwidth of 2PI, and an elevation beamwidth of PI
- ///
- [XmlElement(Type = typeof(float), ElementName = "phase")]
- public float Phase
- {
- get
- {
- return this._phase;
- }
-
- set
- {
- this._phase = value;
- }
- }
-
- ///
- /// Gets or sets the padding
- ///
- [XmlElement(Type = typeof(uint), ElementName = "padding3")]
- public uint Padding3
- {
- get
- {
- return this._padding3;
- }
-
- set
- {
- this._padding3 = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- this._beamDirection.Marshal(dos);
- dos.WriteFloat((float)this._azimuthBeamwidth);
- dos.WriteFloat((float)this._elevationBeamwidth);
- dos.WriteFloat((float)this._referenceSystem);
- dos.WriteUnsignedByte((byte)this._padding1);
- dos.WriteUnsignedShort((ushort)this._padding2);
- dos.WriteFloat((float)this._ez);
- dos.WriteFloat((float)this._ex);
- dos.WriteFloat((float)this._phase);
- dos.WriteUnsignedInt((uint)this._padding3);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._beamDirection.Unmarshal(dis);
- this._azimuthBeamwidth = dis.ReadFloat();
- this._elevationBeamwidth = dis.ReadFloat();
- this._referenceSystem = dis.ReadFloat();
- this._padding1 = dis.ReadUnsignedByte();
- this._padding2 = dis.ReadUnsignedShort();
- this._ez = dis.ReadFloat();
- this._ex = dis.ReadFloat();
- this._phase = dis.ReadFloat();
- this._padding3 = dis.ReadUnsignedInt();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("");
- this._beamDirection.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._azimuthBeamwidth.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._elevationBeamwidth.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._referenceSystem.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._padding1.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._padding2.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._ez.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._ex.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._phase.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._padding3.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as BeamAntennaPattern;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(BeamAntennaPattern obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (!this._beamDirection.Equals(obj._beamDirection))
- {
- ivarsEqual = false;
- }
-
- if (this._azimuthBeamwidth != obj._azimuthBeamwidth)
- {
- ivarsEqual = false;
- }
-
- if (this._elevationBeamwidth != obj._elevationBeamwidth)
- {
- ivarsEqual = false;
- }
-
- if (this._referenceSystem != obj._referenceSystem)
- {
- ivarsEqual = false;
- }
-
- if (this._padding1 != obj._padding1)
- {
- ivarsEqual = false;
- }
-
- if (this._padding2 != obj._padding2)
- {
- ivarsEqual = false;
- }
-
- if (this._ez != obj._ez)
- {
- ivarsEqual = false;
- }
-
- if (this._ex != obj._ex)
- {
- ivarsEqual = false;
- }
-
- if (this._phase != obj._phase)
- {
- ivarsEqual = false;
- }
-
- if (this._padding3 != obj._padding3)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._beamDirection.GetHashCode();
- result = GenerateHash(result) ^ this._azimuthBeamwidth.GetHashCode();
- result = GenerateHash(result) ^ this._elevationBeamwidth.GetHashCode();
- result = GenerateHash(result) ^ this._referenceSystem.GetHashCode();
- result = GenerateHash(result) ^ this._padding1.GetHashCode();
- result = GenerateHash(result) ^ this._padding2.GetHashCode();
- result = GenerateHash(result) ^ this._ez.GetHashCode();
- result = GenerateHash(result) ^ this._ex.GetHashCode();
- result = GenerateHash(result) ^ this._phase.GetHashCode();
- result = GenerateHash(result) ^ this._padding3.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/BeamData.cs b/tests/OpenDisNet.Reference/Generated/BeamData.cs
deleted file mode 100644
index ccbe7a7..0000000
--- a/tests/OpenDisNet.Reference/Generated/BeamData.cs
+++ /dev/null
@@ -1,405 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Describes the scan volue of an emitter beam. Section 6.2.13.
- ///
- [Serializable]
- [XmlRoot]
- public partial class BeamData
- {
- ///
- /// Specifies the beam azimuth an elevation centers and corresponding half-angles to describe the scan volume
- ///
- private float _beamAzimuthCenter;
-
- ///
- /// Specifies the beam azimuth sweep to determine scan volume
- ///
- private float _beamAzimuthSweep;
-
- ///
- /// Specifies the beam elevation center to determine scan volume
- ///
- private float _beamElevationCenter;
-
- ///
- /// Specifies the beam elevation sweep to determine scan volume
- ///
- private float _beamElevationSweep;
-
- ///
- /// allows receiver to synchronize its regenerated scan pattern to that of the emmitter. Specifies the percentage of time a scan is through its pattern from its origion.
- ///
- private float _beamSweepSync;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public BeamData()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(BeamData left, BeamData right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(BeamData left, BeamData right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += 4; // this._beamAzimuthCenter
- marshalSize += 4; // this._beamAzimuthSweep
- marshalSize += 4; // this._beamElevationCenter
- marshalSize += 4; // this._beamElevationSweep
- marshalSize += 4; // this._beamSweepSync
- return marshalSize;
- }
-
- ///
- /// Gets or sets the Specifies the beam azimuth an elevation centers and corresponding half-angles to describe the scan volume
- ///
- [XmlElement(Type = typeof(float), ElementName = "beamAzimuthCenter")]
- public float BeamAzimuthCenter
- {
- get
- {
- return this._beamAzimuthCenter;
- }
-
- set
- {
- this._beamAzimuthCenter = value;
- }
- }
-
- ///
- /// Gets or sets the Specifies the beam azimuth sweep to determine scan volume
- ///
- [XmlElement(Type = typeof(float), ElementName = "beamAzimuthSweep")]
- public float BeamAzimuthSweep
- {
- get
- {
- return this._beamAzimuthSweep;
- }
-
- set
- {
- this._beamAzimuthSweep = value;
- }
- }
-
- ///
- /// Gets or sets the Specifies the beam elevation center to determine scan volume
- ///
- [XmlElement(Type = typeof(float), ElementName = "beamElevationCenter")]
- public float BeamElevationCenter
- {
- get
- {
- return this._beamElevationCenter;
- }
-
- set
- {
- this._beamElevationCenter = value;
- }
- }
-
- ///
- /// Gets or sets the Specifies the beam elevation sweep to determine scan volume
- ///
- [XmlElement(Type = typeof(float), ElementName = "beamElevationSweep")]
- public float BeamElevationSweep
- {
- get
- {
- return this._beamElevationSweep;
- }
-
- set
- {
- this._beamElevationSweep = value;
- }
- }
-
- ///
- /// Gets or sets the allows receiver to synchronize its regenerated scan pattern to that of the emmitter. Specifies the percentage of time a scan is through its pattern from its origion.
- ///
- [XmlElement(Type = typeof(float), ElementName = "beamSweepSync")]
- public float BeamSweepSync
- {
- get
- {
- return this._beamSweepSync;
- }
-
- set
- {
- this._beamSweepSync = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- dos.WriteFloat((float)this._beamAzimuthCenter);
- dos.WriteFloat((float)this._beamAzimuthSweep);
- dos.WriteFloat((float)this._beamElevationCenter);
- dos.WriteFloat((float)this._beamElevationSweep);
- dos.WriteFloat((float)this._beamSweepSync);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._beamAzimuthCenter = dis.ReadFloat();
- this._beamAzimuthSweep = dis.ReadFloat();
- this._beamElevationCenter = dis.ReadFloat();
- this._beamElevationSweep = dis.ReadFloat();
- this._beamSweepSync = dis.ReadFloat();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("" + this._beamAzimuthCenter.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._beamAzimuthSweep.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._beamElevationCenter.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._beamElevationSweep.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._beamSweepSync.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as BeamData;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(BeamData obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (this._beamAzimuthCenter != obj._beamAzimuthCenter)
- {
- ivarsEqual = false;
- }
-
- if (this._beamAzimuthSweep != obj._beamAzimuthSweep)
- {
- ivarsEqual = false;
- }
-
- if (this._beamElevationCenter != obj._beamElevationCenter)
- {
- ivarsEqual = false;
- }
-
- if (this._beamElevationSweep != obj._beamElevationSweep)
- {
- ivarsEqual = false;
- }
-
- if (this._beamSweepSync != obj._beamSweepSync)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._beamAzimuthCenter.GetHashCode();
- result = GenerateHash(result) ^ this._beamAzimuthSweep.GetHashCode();
- result = GenerateHash(result) ^ this._beamElevationCenter.GetHashCode();
- result = GenerateHash(result) ^ this._beamElevationSweep.GetHashCode();
- result = GenerateHash(result) ^ this._beamSweepSync.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/BeamStatus.cs b/tests/OpenDisNet.Reference/Generated/BeamStatus.cs
deleted file mode 100644
index 44d9960..0000000
--- a/tests/OpenDisNet.Reference/Generated/BeamStatus.cs
+++ /dev/null
@@ -1,277 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Information related to the status of a beam. This is contained in the beam status field of the electromagnitec emission PDU. The first bit determines whether the beam is active (0) or deactivated (1).
- ///
- [Serializable]
- [XmlRoot]
- public partial class BeamStatus
- {
- ///
- /// First bit zero means beam is active, first bit = 1 means deactivated. The rest is padding.
- ///
- private byte _beamState;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public BeamStatus()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(BeamStatus left, BeamStatus right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(BeamStatus left, BeamStatus right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += 1; // this._beamState
- return marshalSize;
- }
-
- ///
- /// Gets or sets the First bit zero means beam is active, first bit = 1 means deactivated. The rest is padding.
- ///
- [XmlElement(Type = typeof(byte), ElementName = "beamState")]
- public byte BeamState
- {
- get
- {
- return this._beamState;
- }
-
- set
- {
- this._beamState = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedByte((byte)this._beamState);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._beamState = dis.ReadUnsignedByte();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("" + this._beamState.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as BeamStatus;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(BeamStatus obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (this._beamState != obj._beamState)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._beamState.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/BlankingSector.cs b/tests/OpenDisNet.Reference/Generated/BlankingSector.cs
deleted file mode 100644
index f257d78..0000000
--- a/tests/OpenDisNet.Reference/Generated/BlankingSector.cs
+++ /dev/null
@@ -1,505 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// The Blanking Sector attribute record may be used to convey persistent areas within a scan volume where emitter power for a specific active emitter beam is reduced to an insignificant value. Section 6.2.12
- ///
- [Serializable]
- [XmlRoot]
- public partial class BlankingSector
- {
- private uint _recordType = 3500;
-
- private ushort _recordLength;
-
- private byte _emitterNumber;
-
- private byte _beamNumber;
-
- private byte _stateIndicator;
-
- private float _leftAzimuth;
-
- private float _rightAzimuth;
-
- private float _lowerElevation;
-
- private float _upperElevation;
-
- private float _residualPower;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public BlankingSector()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(BlankingSector left, BlankingSector right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(BlankingSector left, BlankingSector right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += 4; // this._recordType
- marshalSize += 2; // this._recordLength
- marshalSize += 1; // this._emitterNumber
- marshalSize += 1; // this._beamNumber
- marshalSize += 1; // this._stateIndicator
- marshalSize += 4; // this._leftAzimuth
- marshalSize += 4; // this._rightAzimuth
- marshalSize += 4; // this._lowerElevation
- marshalSize += 4; // this._upperElevation
- marshalSize += 4; // this._residualPower
- return marshalSize;
- }
-
- [XmlElement(Type = typeof(uint), ElementName = "recordType")]
- public uint RecordType
- {
- get
- {
- return this._recordType;
- }
-
- set
- {
- this._recordType = value;
- }
- }
-
- [XmlElement(Type = typeof(ushort), ElementName = "recordLength")]
- public ushort RecordLength
- {
- get
- {
- return this._recordLength;
- }
-
- set
- {
- this._recordLength = value;
- }
- }
-
- [XmlElement(Type = typeof(byte), ElementName = "emitterNumber")]
- public byte EmitterNumber
- {
- get
- {
- return this._emitterNumber;
- }
-
- set
- {
- this._emitterNumber = value;
- }
- }
-
- [XmlElement(Type = typeof(byte), ElementName = "beamNumber")]
- public byte BeamNumber
- {
- get
- {
- return this._beamNumber;
- }
-
- set
- {
- this._beamNumber = value;
- }
- }
-
- [XmlElement(Type = typeof(byte), ElementName = "stateIndicator")]
- public byte StateIndicator
- {
- get
- {
- return this._stateIndicator;
- }
-
- set
- {
- this._stateIndicator = value;
- }
- }
-
- [XmlElement(Type = typeof(float), ElementName = "leftAzimuth")]
- public float LeftAzimuth
- {
- get
- {
- return this._leftAzimuth;
- }
-
- set
- {
- this._leftAzimuth = value;
- }
- }
-
- [XmlElement(Type = typeof(float), ElementName = "rightAzimuth")]
- public float RightAzimuth
- {
- get
- {
- return this._rightAzimuth;
- }
-
- set
- {
- this._rightAzimuth = value;
- }
- }
-
- [XmlElement(Type = typeof(float), ElementName = "lowerElevation")]
- public float LowerElevation
- {
- get
- {
- return this._lowerElevation;
- }
-
- set
- {
- this._lowerElevation = value;
- }
- }
-
- [XmlElement(Type = typeof(float), ElementName = "upperElevation")]
- public float UpperElevation
- {
- get
- {
- return this._upperElevation;
- }
-
- set
- {
- this._upperElevation = value;
- }
- }
-
- [XmlElement(Type = typeof(float), ElementName = "residualPower")]
- public float ResidualPower
- {
- get
- {
- return this._residualPower;
- }
-
- set
- {
- this._residualPower = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedInt((uint)this._recordType);
- dos.WriteUnsignedShort((ushort)this._recordLength);
- dos.WriteUnsignedByte((byte)this._emitterNumber);
- dos.WriteUnsignedByte((byte)this._beamNumber);
- dos.WriteUnsignedByte((byte)this._stateIndicator);
- dos.WriteFloat((float)this._leftAzimuth);
- dos.WriteFloat((float)this._rightAzimuth);
- dos.WriteFloat((float)this._lowerElevation);
- dos.WriteFloat((float)this._upperElevation);
- dos.WriteFloat((float)this._residualPower);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._recordType = dis.ReadUnsignedInt();
- this._recordLength = dis.ReadUnsignedShort();
- this._emitterNumber = dis.ReadUnsignedByte();
- this._beamNumber = dis.ReadUnsignedByte();
- this._stateIndicator = dis.ReadUnsignedByte();
- this._leftAzimuth = dis.ReadFloat();
- this._rightAzimuth = dis.ReadFloat();
- this._lowerElevation = dis.ReadFloat();
- this._upperElevation = dis.ReadFloat();
- this._residualPower = dis.ReadFloat();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("" + this._recordType.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._recordLength.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._emitterNumber.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._beamNumber.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._stateIndicator.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._leftAzimuth.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._rightAzimuth.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._lowerElevation.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._upperElevation.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._residualPower.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as BlankingSector;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(BlankingSector obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (this._recordType != obj._recordType)
- {
- ivarsEqual = false;
- }
-
- if (this._recordLength != obj._recordLength)
- {
- ivarsEqual = false;
- }
-
- if (this._emitterNumber != obj._emitterNumber)
- {
- ivarsEqual = false;
- }
-
- if (this._beamNumber != obj._beamNumber)
- {
- ivarsEqual = false;
- }
-
- if (this._stateIndicator != obj._stateIndicator)
- {
- ivarsEqual = false;
- }
-
- if (this._leftAzimuth != obj._leftAzimuth)
- {
- ivarsEqual = false;
- }
-
- if (this._rightAzimuth != obj._rightAzimuth)
- {
- ivarsEqual = false;
- }
-
- if (this._lowerElevation != obj._lowerElevation)
- {
- ivarsEqual = false;
- }
-
- if (this._upperElevation != obj._upperElevation)
- {
- ivarsEqual = false;
- }
-
- if (this._residualPower != obj._residualPower)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._recordType.GetHashCode();
- result = GenerateHash(result) ^ this._recordLength.GetHashCode();
- result = GenerateHash(result) ^ this._emitterNumber.GetHashCode();
- result = GenerateHash(result) ^ this._beamNumber.GetHashCode();
- result = GenerateHash(result) ^ this._stateIndicator.GetHashCode();
- result = GenerateHash(result) ^ this._leftAzimuth.GetHashCode();
- result = GenerateHash(result) ^ this._rightAzimuth.GetHashCode();
- result = GenerateHash(result) ^ this._lowerElevation.GetHashCode();
- result = GenerateHash(result) ^ this._upperElevation.GetHashCode();
- result = GenerateHash(result) ^ this._residualPower.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/ChangeOptions.cs b/tests/OpenDisNet.Reference/Generated/ChangeOptions.cs
deleted file mode 100644
index 92faa76..0000000
--- a/tests/OpenDisNet.Reference/Generated/ChangeOptions.cs
+++ /dev/null
@@ -1,245 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// This is wrong and breaks serialization. See section 6.2.15 aka B.2.41
- ///
- [Serializable]
- [XmlRoot]
- public partial class ChangeOptions
- {
- ///
- /// Initializes a new instance of the class.
- ///
- public ChangeOptions()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(ChangeOptions left, ChangeOptions right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(ChangeOptions left, ChangeOptions right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- return marshalSize;
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as ChangeOptions;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(ChangeOptions obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/ClockTime.cs b/tests/OpenDisNet.Reference/Generated/ClockTime.cs
deleted file mode 100644
index a7348fd..0000000
--- a/tests/OpenDisNet.Reference/Generated/ClockTime.cs
+++ /dev/null
@@ -1,309 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Time measurements that exceed one hour are represented by this record. The first field is the hours since the unix epoch (Jan 1 1970, used by most Unix systems and java) and the second field the timestamp units since the top of the hour. Section 6.2.16
- ///
- [Serializable]
- [XmlRoot]
- public partial class ClockTime
- {
- ///
- /// Hours in UTC
- ///
- private uint _hour;
-
- ///
- /// Time past the hour
- ///
- private uint _timePastHour;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public ClockTime()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(ClockTime left, ClockTime right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(ClockTime left, ClockTime right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += 4; // this._hour
- marshalSize += 4; // this._timePastHour
- return marshalSize;
- }
-
- ///
- /// Gets or sets the Hours in UTC
- ///
- [XmlElement(Type = typeof(uint), ElementName = "hour")]
- public uint Hour
- {
- get
- {
- return this._hour;
- }
-
- set
- {
- this._hour = value;
- }
- }
-
- ///
- /// Gets or sets the Time past the hour
- ///
- [XmlElement(Type = typeof(uint), ElementName = "timePastHour")]
- public uint TimePastHour
- {
- get
- {
- return this._timePastHour;
- }
-
- set
- {
- this._timePastHour = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedInt((uint)this._hour);
- dos.WriteUnsignedInt((uint)this._timePastHour);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._hour = dis.ReadUnsignedInt();
- this._timePastHour = dis.ReadUnsignedInt();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("" + this._hour.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._timePastHour.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as ClockTime;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(ClockTime obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (this._hour != obj._hour)
- {
- ivarsEqual = false;
- }
-
- if (this._timePastHour != obj._timePastHour)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._hour.GetHashCode();
- result = GenerateHash(result) ^ this._timePastHour.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/CollisionElasticPdu.cs b/tests/OpenDisNet.Reference/Generated/CollisionElasticPdu.cs
deleted file mode 100644
index 892252d..0000000
--- a/tests/OpenDisNet.Reference/Generated/CollisionElasticPdu.cs
+++ /dev/null
@@ -1,745 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Information about elastic collisions in a DIS exercise shall be communicated using a Collision-Elastic PDU. Section 7.2.4. COMPLETE
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(EntityID))]
- [XmlInclude(typeof(EventIdentifier))]
- [XmlInclude(typeof(Vector3Float))]
- public partial class CollisionElasticPdu : EntityInformationFamilyPdu, IEquatable
- {
- ///
- /// This field shall identify the entity that is issuing the PDU and shall be represented by an Entity Identifier record (see 6.2.28)
- ///
- private EntityID _issuingEntityID = new EntityID();
-
- ///
- /// This field shall identify the entity that has collided with the issuing entity. This field shall be a valid identifier of an entity or server capable of responding to the receipt of this Collision-Elastic PDU. This field shall be represented by an Entity Identifier record (see 6.2.28).
- ///
- private EntityID _collidingEntityID = new EntityID();
-
- ///
- /// This field shall contain an identification generated by the issuing simulation application to associate related collision events. This field shall be represented by an Event Identifier record (see 6.2.34).
- ///
- private EventIdentifier _collisionEventID = new EventIdentifier();
-
- ///
- /// some padding
- ///
- private short _pad;
-
- ///
- /// This field shall contain the velocity at the time the collision is detected at the point the collision is detected. The velocity shall be represented in world coordinates. This field shall be represented by the Linear Velocity Vector record [see 6.2.95 item c)]
- ///
- private Vector3Float _contactVelocity = new Vector3Float();
-
- ///
- /// This field shall contain the mass of the issuing entity and shall be represented by a 32-bit floating point number representing kilograms
- ///
- private float _mass;
-
- ///
- /// This field shall specify the location of the collision with respect to the entity with which the issuing entity collided. This field shall be represented by an Entity Coordinate Vector record [see 6.2.95 item a)].
- ///
- private Vector3Float _locationOfImpact = new Vector3Float();
-
- ///
- /// These six records represent the six independent components of a positive semi-definite matrix formed by pre-multiplying and post-multiplying the tensor of inertia, by the anti-symmetric matrix generated by the moment arm, and shall be represented by 32-bit floating point numbers (see 5.3.4.4)
- ///
- private float _collisionIntermediateResultXX;
-
- ///
- /// tensor values
- ///
- private float _collisionIntermediateResultXY;
-
- ///
- /// tensor values
- ///
- private float _collisionIntermediateResultXZ;
-
- ///
- /// tensor values
- ///
- private float _collisionIntermediateResultYY;
-
- ///
- /// tensor values
- ///
- private float _collisionIntermediateResultYZ;
-
- ///
- /// tensor values
- ///
- private float _collisionIntermediateResultZZ;
-
- ///
- /// This record shall represent the normal vector to the surface at the point of collision detection. The surface normal shall be represented in world coordinates. This field shall be represented by an Entity Coordinate Vector record [see 6.2.95 item a)].
- ///
- private Vector3Float _unitSurfaceNormal = new Vector3Float();
-
- ///
- /// This field shall represent the degree to which energy is conserved in a collision and shall be represented by a 32-bit floating point number. In addition, it represents a free parameter by which simulation application developers may “tune” their collision interactions.
- ///
- private float _coefficientOfRestitution;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public CollisionElasticPdu()
- {
- PduType = (byte)66;
- ProtocolFamily = (byte)1;
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(CollisionElasticPdu left, CollisionElasticPdu right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(CollisionElasticPdu left, CollisionElasticPdu right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public override int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize = base.GetMarshalledSize();
- marshalSize += this._issuingEntityID.GetMarshalledSize(); // this._issuingEntityID
- marshalSize += this._collidingEntityID.GetMarshalledSize(); // this._collidingEntityID
- marshalSize += this._collisionEventID.GetMarshalledSize(); // this._collisionEventID
- marshalSize += 2; // this._pad
- marshalSize += this._contactVelocity.GetMarshalledSize(); // this._contactVelocity
- marshalSize += 4; // this._mass
- marshalSize += this._locationOfImpact.GetMarshalledSize(); // this._locationOfImpact
- marshalSize += 4; // this._collisionIntermediateResultXX
- marshalSize += 4; // this._collisionIntermediateResultXY
- marshalSize += 4; // this._collisionIntermediateResultXZ
- marshalSize += 4; // this._collisionIntermediateResultYY
- marshalSize += 4; // this._collisionIntermediateResultYZ
- marshalSize += 4; // this._collisionIntermediateResultZZ
- marshalSize += this._unitSurfaceNormal.GetMarshalledSize(); // this._unitSurfaceNormal
- marshalSize += 4; // this._coefficientOfRestitution
- return marshalSize;
- }
-
- ///
- /// Gets or sets the This field shall identify the entity that is issuing the PDU and shall be represented by an Entity Identifier record (see 6.2.28)
- ///
- [XmlElement(Type = typeof(EntityID), ElementName = "issuingEntityID")]
- public EntityID IssuingEntityID
- {
- get
- {
- return this._issuingEntityID;
- }
-
- set
- {
- this._issuingEntityID = value;
- }
- }
-
- ///
- /// Gets or sets the This field shall identify the entity that has collided with the issuing entity. This field shall be a valid identifier of an entity or server capable of responding to the receipt of this Collision-Elastic PDU. This field shall be represented by an Entity Identifier record (see 6.2.28).
- ///
- [XmlElement(Type = typeof(EntityID), ElementName = "collidingEntityID")]
- public EntityID CollidingEntityID
- {
- get
- {
- return this._collidingEntityID;
- }
-
- set
- {
- this._collidingEntityID = value;
- }
- }
-
- ///
- /// Gets or sets the This field shall contain an identification generated by the issuing simulation application to associate related collision events. This field shall be represented by an Event Identifier record (see 6.2.34).
- ///
- [XmlElement(Type = typeof(EventIdentifier), ElementName = "collisionEventID")]
- public EventIdentifier CollisionEventID
- {
- get
- {
- return this._collisionEventID;
- }
-
- set
- {
- this._collisionEventID = value;
- }
- }
-
- ///
- /// Gets or sets the some padding
- ///
- [XmlElement(Type = typeof(short), ElementName = "pad")]
- public short Pad
- {
- get
- {
- return this._pad;
- }
-
- set
- {
- this._pad = value;
- }
- }
-
- ///
- /// Gets or sets the This field shall contain the velocity at the time the collision is detected at the point the collision is detected. The velocity shall be represented in world coordinates. This field shall be represented by the Linear Velocity Vector record [see 6.2.95 item c)]
- ///
- [XmlElement(Type = typeof(Vector3Float), ElementName = "contactVelocity")]
- public Vector3Float ContactVelocity
- {
- get
- {
- return this._contactVelocity;
- }
-
- set
- {
- this._contactVelocity = value;
- }
- }
-
- ///
- /// Gets or sets the This field shall contain the mass of the issuing entity and shall be represented by a 32-bit floating point number representing kilograms
- ///
- [XmlElement(Type = typeof(float), ElementName = "mass")]
- public float Mass
- {
- get
- {
- return this._mass;
- }
-
- set
- {
- this._mass = value;
- }
- }
-
- ///
- /// Gets or sets the This field shall specify the location of the collision with respect to the entity with which the issuing entity collided. This field shall be represented by an Entity Coordinate Vector record [see 6.2.95 item a)].
- ///
- [XmlElement(Type = typeof(Vector3Float), ElementName = "locationOfImpact")]
- public Vector3Float LocationOfImpact
- {
- get
- {
- return this._locationOfImpact;
- }
-
- set
- {
- this._locationOfImpact = value;
- }
- }
-
- ///
- /// Gets or sets the These six records represent the six independent components of a positive semi-definite matrix formed by pre-multiplying and post-multiplying the tensor of inertia, by the anti-symmetric matrix generated by the moment arm, and shall be represented by 32-bit floating point numbers (see 5.3.4.4)
- ///
- [XmlElement(Type = typeof(float), ElementName = "collisionIntermediateResultXX")]
- public float CollisionIntermediateResultXX
- {
- get
- {
- return this._collisionIntermediateResultXX;
- }
-
- set
- {
- this._collisionIntermediateResultXX = value;
- }
- }
-
- ///
- /// Gets or sets the tensor values
- ///
- [XmlElement(Type = typeof(float), ElementName = "collisionIntermediateResultXY")]
- public float CollisionIntermediateResultXY
- {
- get
- {
- return this._collisionIntermediateResultXY;
- }
-
- set
- {
- this._collisionIntermediateResultXY = value;
- }
- }
-
- ///
- /// Gets or sets the tensor values
- ///
- [XmlElement(Type = typeof(float), ElementName = "collisionIntermediateResultXZ")]
- public float CollisionIntermediateResultXZ
- {
- get
- {
- return this._collisionIntermediateResultXZ;
- }
-
- set
- {
- this._collisionIntermediateResultXZ = value;
- }
- }
-
- ///
- /// Gets or sets the tensor values
- ///
- [XmlElement(Type = typeof(float), ElementName = "collisionIntermediateResultYY")]
- public float CollisionIntermediateResultYY
- {
- get
- {
- return this._collisionIntermediateResultYY;
- }
-
- set
- {
- this._collisionIntermediateResultYY = value;
- }
- }
-
- ///
- /// Gets or sets the tensor values
- ///
- [XmlElement(Type = typeof(float), ElementName = "collisionIntermediateResultYZ")]
- public float CollisionIntermediateResultYZ
- {
- get
- {
- return this._collisionIntermediateResultYZ;
- }
-
- set
- {
- this._collisionIntermediateResultYZ = value;
- }
- }
-
- ///
- /// Gets or sets the tensor values
- ///
- [XmlElement(Type = typeof(float), ElementName = "collisionIntermediateResultZZ")]
- public float CollisionIntermediateResultZZ
- {
- get
- {
- return this._collisionIntermediateResultZZ;
- }
-
- set
- {
- this._collisionIntermediateResultZZ = value;
- }
- }
-
- ///
- /// Gets or sets the This record shall represent the normal vector to the surface at the point of collision detection. The surface normal shall be represented in world coordinates. This field shall be represented by an Entity Coordinate Vector record [see 6.2.95 item a)].
- ///
- [XmlElement(Type = typeof(Vector3Float), ElementName = "unitSurfaceNormal")]
- public Vector3Float UnitSurfaceNormal
- {
- get
- {
- return this._unitSurfaceNormal;
- }
-
- set
- {
- this._unitSurfaceNormal = value;
- }
- }
-
- ///
- /// Gets or sets the This field shall represent the degree to which energy is conserved in a collision and shall be represented by a 32-bit floating point number. In addition, it represents a free parameter by which simulation application developers may “tune” their collision interactions.
- ///
- [XmlElement(Type = typeof(float), ElementName = "coefficientOfRestitution")]
- public float CoefficientOfRestitution
- {
- get
- {
- return this._coefficientOfRestitution;
- }
-
- set
- {
- this._coefficientOfRestitution = value;
- }
- }
-
- ///
- /// Automatically sets the length of the marshalled data, then calls the marshal method.
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- public override void MarshalAutoLengthSet(DataOutputStream dos)
- {
- // Set the length prior to marshalling data
- this.Length = (ushort)this.GetMarshalledSize();
- this.Marshal(dos);
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Marshal(DataOutputStream dos)
- {
- base.Marshal(dos);
- if (dos != null)
- {
- try
- {
- this._issuingEntityID.Marshal(dos);
- this._collidingEntityID.Marshal(dos);
- this._collisionEventID.Marshal(dos);
- dos.WriteShort((short)this._pad);
- this._contactVelocity.Marshal(dos);
- dos.WriteFloat((float)this._mass);
- this._locationOfImpact.Marshal(dos);
- dos.WriteFloat((float)this._collisionIntermediateResultXX);
- dos.WriteFloat((float)this._collisionIntermediateResultXY);
- dos.WriteFloat((float)this._collisionIntermediateResultXZ);
- dos.WriteFloat((float)this._collisionIntermediateResultYY);
- dos.WriteFloat((float)this._collisionIntermediateResultYZ);
- dos.WriteFloat((float)this._collisionIntermediateResultZZ);
- this._unitSurfaceNormal.Marshal(dos);
- dos.WriteFloat((float)this._coefficientOfRestitution);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Unmarshal(DataInputStream dis)
- {
- base.Unmarshal(dis);
-
- if (dis != null)
- {
- try
- {
- this._issuingEntityID.Unmarshal(dis);
- this._collidingEntityID.Unmarshal(dis);
- this._collisionEventID.Unmarshal(dis);
- this._pad = dis.ReadShort();
- this._contactVelocity.Unmarshal(dis);
- this._mass = dis.ReadFloat();
- this._locationOfImpact.Unmarshal(dis);
- this._collisionIntermediateResultXX = dis.ReadFloat();
- this._collisionIntermediateResultXY = dis.ReadFloat();
- this._collisionIntermediateResultXZ = dis.ReadFloat();
- this._collisionIntermediateResultYY = dis.ReadFloat();
- this._collisionIntermediateResultYZ = dis.ReadFloat();
- this._collisionIntermediateResultZZ = dis.ReadFloat();
- this._unitSurfaceNormal.Unmarshal(dis);
- this._coefficientOfRestitution = dis.ReadFloat();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- base.Reflection(sb);
- try
- {
- sb.AppendLine("");
- this._issuingEntityID.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- this._collidingEntityID.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- this._collisionEventID.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._pad.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- this._contactVelocity.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._mass.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- this._locationOfImpact.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._collisionIntermediateResultXX.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._collisionIntermediateResultXY.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._collisionIntermediateResultXZ.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._collisionIntermediateResultYY.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._collisionIntermediateResultYZ.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._collisionIntermediateResultZZ.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- this._unitSurfaceNormal.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._coefficientOfRestitution.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as CollisionElasticPdu;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(CollisionElasticPdu obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- ivarsEqual = base.Equals(obj);
-
- if (!this._issuingEntityID.Equals(obj._issuingEntityID))
- {
- ivarsEqual = false;
- }
-
- if (!this._collidingEntityID.Equals(obj._collidingEntityID))
- {
- ivarsEqual = false;
- }
-
- if (!this._collisionEventID.Equals(obj._collisionEventID))
- {
- ivarsEqual = false;
- }
-
- if (this._pad != obj._pad)
- {
- ivarsEqual = false;
- }
-
- if (!this._contactVelocity.Equals(obj._contactVelocity))
- {
- ivarsEqual = false;
- }
-
- if (this._mass != obj._mass)
- {
- ivarsEqual = false;
- }
-
- if (!this._locationOfImpact.Equals(obj._locationOfImpact))
- {
- ivarsEqual = false;
- }
-
- if (this._collisionIntermediateResultXX != obj._collisionIntermediateResultXX)
- {
- ivarsEqual = false;
- }
-
- if (this._collisionIntermediateResultXY != obj._collisionIntermediateResultXY)
- {
- ivarsEqual = false;
- }
-
- if (this._collisionIntermediateResultXZ != obj._collisionIntermediateResultXZ)
- {
- ivarsEqual = false;
- }
-
- if (this._collisionIntermediateResultYY != obj._collisionIntermediateResultYY)
- {
- ivarsEqual = false;
- }
-
- if (this._collisionIntermediateResultYZ != obj._collisionIntermediateResultYZ)
- {
- ivarsEqual = false;
- }
-
- if (this._collisionIntermediateResultZZ != obj._collisionIntermediateResultZZ)
- {
- ivarsEqual = false;
- }
-
- if (!this._unitSurfaceNormal.Equals(obj._unitSurfaceNormal))
- {
- ivarsEqual = false;
- }
-
- if (this._coefficientOfRestitution != obj._coefficientOfRestitution)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ base.GetHashCode();
-
- result = GenerateHash(result) ^ this._issuingEntityID.GetHashCode();
- result = GenerateHash(result) ^ this._collidingEntityID.GetHashCode();
- result = GenerateHash(result) ^ this._collisionEventID.GetHashCode();
- result = GenerateHash(result) ^ this._pad.GetHashCode();
- result = GenerateHash(result) ^ this._contactVelocity.GetHashCode();
- result = GenerateHash(result) ^ this._mass.GetHashCode();
- result = GenerateHash(result) ^ this._locationOfImpact.GetHashCode();
- result = GenerateHash(result) ^ this._collisionIntermediateResultXX.GetHashCode();
- result = GenerateHash(result) ^ this._collisionIntermediateResultXY.GetHashCode();
- result = GenerateHash(result) ^ this._collisionIntermediateResultXZ.GetHashCode();
- result = GenerateHash(result) ^ this._collisionIntermediateResultYY.GetHashCode();
- result = GenerateHash(result) ^ this._collisionIntermediateResultYZ.GetHashCode();
- result = GenerateHash(result) ^ this._collisionIntermediateResultZZ.GetHashCode();
- result = GenerateHash(result) ^ this._unitSurfaceNormal.GetHashCode();
- result = GenerateHash(result) ^ this._coefficientOfRestitution.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/CollisionPdu.cs b/tests/OpenDisNet.Reference/Generated/CollisionPdu.cs
deleted file mode 100644
index c4d4e5a..0000000
--- a/tests/OpenDisNet.Reference/Generated/CollisionPdu.cs
+++ /dev/null
@@ -1,519 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Section 7.2.3 Collisions between entities shall be communicated by issuing a Collision PDU. COMPLETE
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(EntityID))]
- [XmlInclude(typeof(EventIdentifier))]
- [XmlInclude(typeof(Vector3Float))]
- public partial class CollisionPdu : EntityInformationFamilyPdu, IEquatable
- {
- ///
- /// This field shall identify the entity that is issuing the PDU, and shall be represented by an Entity Identifier record (see 6.2.28).
- ///
- private EntityID _issuingEntityID = new EntityID();
-
- ///
- /// This field shall identify the entity that has collided with the issuing entity (see 5.3.3.4). This field shall be represented by an Entity Identifier record (see 6.2.28).
- ///
- private EntityID _collidingEntityID = new EntityID();
-
- ///
- /// This field shall contain an identification generated by the issuing simulation application to associate related collision events. This field shall be represented by an Event Identifier record (see 6.2.34).
- ///
- private EventIdentifier _eventID = new EventIdentifier();
-
- ///
- /// This field shall identify the type of collision. The Collision Type field shall be represented by an 8-bit record of enumerations
- ///
- private byte _collisionType;
-
- ///
- /// some padding
- ///
- private byte _pad;
-
- ///
- /// This field shall contain the velocity (at the time the collision is detected) of the issuing entity. The velocity shall be represented in world coordinates. This field shall be represented by the Linear Velocity Vector record [see 6.2.95 item c)].
- ///
- private Vector3Float _velocity = new Vector3Float();
-
- ///
- /// This field shall contain the mass of the issuing entity, and shall be represented by a 32-bit floating point number representing kilograms.
- ///
- private float _mass;
-
- ///
- /// This field shall specify the location of the collision with respect to the entity with which the issuing entity collided. The Location field shall be represented by an Entity Coordinate Vector record [see 6.2.95 item a)].
- ///
- private Vector3Float _location = new Vector3Float();
-
- ///
- /// Initializes a new instance of the class.
- ///
- public CollisionPdu()
- {
- PduType = (byte)4;
- ProtocolFamily = (byte)1;
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(CollisionPdu left, CollisionPdu right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(CollisionPdu left, CollisionPdu right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public override int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize = base.GetMarshalledSize();
- marshalSize += this._issuingEntityID.GetMarshalledSize(); // this._issuingEntityID
- marshalSize += this._collidingEntityID.GetMarshalledSize(); // this._collidingEntityID
- marshalSize += this._eventID.GetMarshalledSize(); // this._eventID
- marshalSize += 1; // this._collisionType
- marshalSize += 1; // this._pad
- marshalSize += this._velocity.GetMarshalledSize(); // this._velocity
- marshalSize += 4; // this._mass
- marshalSize += this._location.GetMarshalledSize(); // this._location
- return marshalSize;
- }
-
- ///
- /// Gets or sets the This field shall identify the entity that is issuing the PDU, and shall be represented by an Entity Identifier record (see 6.2.28).
- ///
- [XmlElement(Type = typeof(EntityID), ElementName = "issuingEntityID")]
- public EntityID IssuingEntityID
- {
- get
- {
- return this._issuingEntityID;
- }
-
- set
- {
- this._issuingEntityID = value;
- }
- }
-
- ///
- /// Gets or sets the This field shall identify the entity that has collided with the issuing entity (see 5.3.3.4). This field shall be represented by an Entity Identifier record (see 6.2.28).
- ///
- [XmlElement(Type = typeof(EntityID), ElementName = "collidingEntityID")]
- public EntityID CollidingEntityID
- {
- get
- {
- return this._collidingEntityID;
- }
-
- set
- {
- this._collidingEntityID = value;
- }
- }
-
- ///
- /// Gets or sets the This field shall contain an identification generated by the issuing simulation application to associate related collision events. This field shall be represented by an Event Identifier record (see 6.2.34).
- ///
- [XmlElement(Type = typeof(EventIdentifier), ElementName = "eventID")]
- public EventIdentifier EventID
- {
- get
- {
- return this._eventID;
- }
-
- set
- {
- this._eventID = value;
- }
- }
-
- ///
- /// Gets or sets the This field shall identify the type of collision. The Collision Type field shall be represented by an 8-bit record of enumerations
- ///
- [XmlElement(Type = typeof(byte), ElementName = "collisionType")]
- public byte CollisionType
- {
- get
- {
- return this._collisionType;
- }
-
- set
- {
- this._collisionType = value;
- }
- }
-
- ///
- /// Gets or sets the some padding
- ///
- [XmlElement(Type = typeof(byte), ElementName = "pad")]
- public byte Pad
- {
- get
- {
- return this._pad;
- }
-
- set
- {
- this._pad = value;
- }
- }
-
- ///
- /// Gets or sets the This field shall contain the velocity (at the time the collision is detected) of the issuing entity. The velocity shall be represented in world coordinates. This field shall be represented by the Linear Velocity Vector record [see 6.2.95 item c)].
- ///
- [XmlElement(Type = typeof(Vector3Float), ElementName = "velocity")]
- public Vector3Float Velocity
- {
- get
- {
- return this._velocity;
- }
-
- set
- {
- this._velocity = value;
- }
- }
-
- ///
- /// Gets or sets the This field shall contain the mass of the issuing entity, and shall be represented by a 32-bit floating point number representing kilograms.
- ///
- [XmlElement(Type = typeof(float), ElementName = "mass")]
- public float Mass
- {
- get
- {
- return this._mass;
- }
-
- set
- {
- this._mass = value;
- }
- }
-
- ///
- /// Gets or sets the This field shall specify the location of the collision with respect to the entity with which the issuing entity collided. The Location field shall be represented by an Entity Coordinate Vector record [see 6.2.95 item a)].
- ///
- [XmlElement(Type = typeof(Vector3Float), ElementName = "location")]
- public Vector3Float Location
- {
- get
- {
- return this._location;
- }
-
- set
- {
- this._location = value;
- }
- }
-
- ///
- /// Automatically sets the length of the marshalled data, then calls the marshal method.
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- public override void MarshalAutoLengthSet(DataOutputStream dos)
- {
- // Set the length prior to marshalling data
- this.Length = (ushort)this.GetMarshalledSize();
- this.Marshal(dos);
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Marshal(DataOutputStream dos)
- {
- base.Marshal(dos);
- if (dos != null)
- {
- try
- {
- this._issuingEntityID.Marshal(dos);
- this._collidingEntityID.Marshal(dos);
- this._eventID.Marshal(dos);
- dos.WriteUnsignedByte((byte)this._collisionType);
- dos.WriteByte((byte)this._pad);
- this._velocity.Marshal(dos);
- dos.WriteFloat((float)this._mass);
- this._location.Marshal(dos);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Unmarshal(DataInputStream dis)
- {
- base.Unmarshal(dis);
-
- if (dis != null)
- {
- try
- {
- this._issuingEntityID.Unmarshal(dis);
- this._collidingEntityID.Unmarshal(dis);
- this._eventID.Unmarshal(dis);
- this._collisionType = dis.ReadUnsignedByte();
- this._pad = dis.ReadByte();
- this._velocity.Unmarshal(dis);
- this._mass = dis.ReadFloat();
- this._location.Unmarshal(dis);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- base.Reflection(sb);
- try
- {
- sb.AppendLine("");
- this._issuingEntityID.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- this._collidingEntityID.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- this._eventID.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._collisionType.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._pad.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- this._velocity.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._mass.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- this._location.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as CollisionPdu;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(CollisionPdu obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- ivarsEqual = base.Equals(obj);
-
- if (!this._issuingEntityID.Equals(obj._issuingEntityID))
- {
- ivarsEqual = false;
- }
-
- if (!this._collidingEntityID.Equals(obj._collidingEntityID))
- {
- ivarsEqual = false;
- }
-
- if (!this._eventID.Equals(obj._eventID))
- {
- ivarsEqual = false;
- }
-
- if (this._collisionType != obj._collisionType)
- {
- ivarsEqual = false;
- }
-
- if (this._pad != obj._pad)
- {
- ivarsEqual = false;
- }
-
- if (!this._velocity.Equals(obj._velocity))
- {
- ivarsEqual = false;
- }
-
- if (this._mass != obj._mass)
- {
- ivarsEqual = false;
- }
-
- if (!this._location.Equals(obj._location))
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ base.GetHashCode();
-
- result = GenerateHash(result) ^ this._issuingEntityID.GetHashCode();
- result = GenerateHash(result) ^ this._collidingEntityID.GetHashCode();
- result = GenerateHash(result) ^ this._eventID.GetHashCode();
- result = GenerateHash(result) ^ this._collisionType.GetHashCode();
- result = GenerateHash(result) ^ this._pad.GetHashCode();
- result = GenerateHash(result) ^ this._velocity.GetHashCode();
- result = GenerateHash(result) ^ this._mass.GetHashCode();
- result = GenerateHash(result) ^ this._location.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/CommentPdu.cs b/tests/OpenDisNet.Reference/Generated/CommentPdu.cs
deleted file mode 100644
index 1e6645a..0000000
--- a/tests/OpenDisNet.Reference/Generated/CommentPdu.cs
+++ /dev/null
@@ -1,455 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Arbitrary messages can be entered into the data stream via use of this PDU. Section 7.5.13 COMPLETE
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(FixedDatum))]
- [XmlInclude(typeof(VariableDatum))]
- public partial class CommentPdu : SimulationManagementFamilyPdu, IEquatable
- {
- ///
- /// Number of fixed datum records
- ///
- private uint _numberOfFixedDatumRecords;
-
- ///
- /// Number of variable datum records
- ///
- private uint _numberOfVariableDatumRecords;
-
- ///
- /// variable length list of fixed datums
- ///
- private List _fixedDatums = new List();
-
- ///
- /// variable length list of variable length datums
- ///
- private List _variableDatums = new List();
-
- ///
- /// Initializes a new instance of the class.
- ///
- public CommentPdu()
- {
- PduType = (byte)22;
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(CommentPdu left, CommentPdu right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(CommentPdu left, CommentPdu right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public override int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize = base.GetMarshalledSize();
- marshalSize += 4; // this._numberOfFixedDatumRecords
- marshalSize += 4; // this._numberOfVariableDatumRecords
- for (int idx = 0; idx < this._fixedDatums.Count; idx++)
- {
- FixedDatum listElement = (FixedDatum)this._fixedDatums[idx];
- marshalSize += listElement.GetMarshalledSize();
- }
-
- for (int idx = 0; idx < this._variableDatums.Count; idx++)
- {
- VariableDatum listElement = (VariableDatum)this._variableDatums[idx];
- marshalSize += listElement.GetMarshalledSize();
- }
-
- return marshalSize;
- }
-
- ///
- /// Note that setting this value will not change the marshalled value. The list whose length this describes is used for that purpose.
- /// The getnumberOfFixedDatumRecords method will also be based on the actual list length rather than this value.
- /// The method is simply here for completeness and should not be used for any computations.
- ///
- [XmlElement(Type = typeof(uint), ElementName = "numberOfFixedDatumRecords")]
- public uint NumberOfFixedDatumRecords
- {
- get
- {
- return this._numberOfFixedDatumRecords;
- }
-
- set
- {
- this._numberOfFixedDatumRecords = value;
- }
- }
-
- ///
- /// Note that setting this value will not change the marshalled value. The list whose length this describes is used for that purpose.
- /// The getnumberOfVariableDatumRecords method will also be based on the actual list length rather than this value.
- /// The method is simply here for completeness and should not be used for any computations.
- ///
- [XmlElement(Type = typeof(uint), ElementName = "numberOfVariableDatumRecords")]
- public uint NumberOfVariableDatumRecords
- {
- get
- {
- return this._numberOfVariableDatumRecords;
- }
-
- set
- {
- this._numberOfVariableDatumRecords = value;
- }
- }
-
- ///
- /// Gets or sets the variable length list of fixed datums
- ///
- [XmlElement(ElementName = "fixedDatumsList", Type = typeof(List))]
- public List FixedDatums
- {
- get
- {
- return this._fixedDatums;
- }
- }
-
- ///
- /// Gets or sets the variable length list of variable length datums
- ///
- [XmlElement(ElementName = "variableDatumsList", Type = typeof(List))]
- public List VariableDatums
- {
- get
- {
- return this._variableDatums;
- }
- }
-
- ///
- /// Automatically sets the length of the marshalled data, then calls the marshal method.
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- public override void MarshalAutoLengthSet(DataOutputStream dos)
- {
- // Set the length prior to marshalling data
- this.Length = (ushort)this.GetMarshalledSize();
- this.Marshal(dos);
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Marshal(DataOutputStream dos)
- {
- base.Marshal(dos);
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedInt((uint)this._fixedDatums.Count);
- dos.WriteUnsignedInt((uint)this._variableDatums.Count);
-
- for (int idx = 0; idx < this._fixedDatums.Count; idx++)
- {
- FixedDatum aFixedDatum = (FixedDatum)this._fixedDatums[idx];
- aFixedDatum.Marshal(dos);
- }
-
- for (int idx = 0; idx < this._variableDatums.Count; idx++)
- {
- VariableDatum aVariableDatum = (VariableDatum)this._variableDatums[idx];
- aVariableDatum.Marshal(dos);
- }
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Unmarshal(DataInputStream dis)
- {
- base.Unmarshal(dis);
-
- if (dis != null)
- {
- try
- {
- this._numberOfFixedDatumRecords = dis.ReadUnsignedInt();
- this._numberOfVariableDatumRecords = dis.ReadUnsignedInt();
- for (int idx = 0; idx < this.NumberOfFixedDatumRecords; idx++)
- {
- FixedDatum anX = new FixedDatum();
- anX.Unmarshal(dis);
- this._fixedDatums.Add(anX);
- };
-
- for (int idx = 0; idx < this.NumberOfVariableDatumRecords; idx++)
- {
- VariableDatum anX = new VariableDatum();
- anX.Unmarshal(dis);
- this._variableDatums.Add(anX);
- };
-
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- base.Reflection(sb);
- try
- {
- sb.AppendLine("" + this._fixedDatums.Count.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._variableDatums.Count.ToString(CultureInfo.InvariantCulture) + "");
- for (int idx = 0; idx < this._fixedDatums.Count; idx++)
- {
- sb.AppendLine("");
- FixedDatum aFixedDatum = (FixedDatum)this._fixedDatums[idx];
- aFixedDatum.Reflection(sb);
- sb.AppendLine("");
- }
-
- for (int idx = 0; idx < this._variableDatums.Count; idx++)
- {
- sb.AppendLine("");
- VariableDatum aVariableDatum = (VariableDatum)this._variableDatums[idx];
- aVariableDatum.Reflection(sb);
- sb.AppendLine("");
- }
-
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as CommentPdu;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(CommentPdu obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- ivarsEqual = base.Equals(obj);
-
- if (this._numberOfFixedDatumRecords != obj._numberOfFixedDatumRecords)
- {
- ivarsEqual = false;
- }
-
- if (this._numberOfVariableDatumRecords != obj._numberOfVariableDatumRecords)
- {
- ivarsEqual = false;
- }
-
- if (this._fixedDatums.Count != obj._fixedDatums.Count)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < this._fixedDatums.Count; idx++)
- {
- if (!this._fixedDatums[idx].Equals(obj._fixedDatums[idx]))
- {
- ivarsEqual = false;
- }
- }
- }
-
- if (this._variableDatums.Count != obj._variableDatums.Count)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < this._variableDatums.Count; idx++)
- {
- if (!this._variableDatums[idx].Equals(obj._variableDatums[idx]))
- {
- ivarsEqual = false;
- }
- }
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ base.GetHashCode();
-
- result = GenerateHash(result) ^ this._numberOfFixedDatumRecords.GetHashCode();
- result = GenerateHash(result) ^ this._numberOfVariableDatumRecords.GetHashCode();
-
- if (this._fixedDatums.Count > 0)
- {
- for (int idx = 0; idx < this._fixedDatums.Count; idx++)
- {
- result = GenerateHash(result) ^ this._fixedDatums[idx].GetHashCode();
- }
- }
-
- if (this._variableDatums.Count > 0)
- {
- for (int idx = 0; idx < this._variableDatums.Count; idx++)
- {
- result = GenerateHash(result) ^ this._variableDatums[idx].GetHashCode();
- }
- }
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/CommentReliablePdu.cs b/tests/OpenDisNet.Reference/Generated/CommentReliablePdu.cs
deleted file mode 100644
index 51b5b58..0000000
--- a/tests/OpenDisNet.Reference/Generated/CommentReliablePdu.cs
+++ /dev/null
@@ -1,455 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Section 5.3.12.12: Arbitrary messages. Only reliable this time. Neds manual intervention to fix padding in variable datums. UNFINISHED
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(FixedDatum))]
- [XmlInclude(typeof(VariableDatum))]
- public partial class CommentReliablePdu : SimulationManagementWithReliabilityFamilyPdu, IEquatable
- {
- ///
- /// Fixed datum record count
- ///
- private uint _numberOfFixedDatumRecords;
-
- ///
- /// variable datum record count
- ///
- private uint _numberOfVariableDatumRecords;
-
- ///
- /// Fixed datum records
- ///
- private List _fixedDatumRecords = new List();
-
- ///
- /// Variable datum records
- ///
- private List _variableDatumRecords = new List();
-
- ///
- /// Initializes a new instance of the class.
- ///
- public CommentReliablePdu()
- {
- PduType = (byte)62;
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(CommentReliablePdu left, CommentReliablePdu right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(CommentReliablePdu left, CommentReliablePdu right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public override int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize = base.GetMarshalledSize();
- marshalSize += 4; // this._numberOfFixedDatumRecords
- marshalSize += 4; // this._numberOfVariableDatumRecords
- for (int idx = 0; idx < this._fixedDatumRecords.Count; idx++)
- {
- FixedDatum listElement = (FixedDatum)this._fixedDatumRecords[idx];
- marshalSize += listElement.GetMarshalledSize();
- }
-
- for (int idx = 0; idx < this._variableDatumRecords.Count; idx++)
- {
- VariableDatum listElement = (VariableDatum)this._variableDatumRecords[idx];
- marshalSize += listElement.GetMarshalledSize();
- }
-
- return marshalSize;
- }
-
- ///
- /// Note that setting this value will not change the marshalled value. The list whose length this describes is used for that purpose.
- /// The getnumberOfFixedDatumRecords method will also be based on the actual list length rather than this value.
- /// The method is simply here for completeness and should not be used for any computations.
- ///
- [XmlElement(Type = typeof(uint), ElementName = "numberOfFixedDatumRecords")]
- public uint NumberOfFixedDatumRecords
- {
- get
- {
- return this._numberOfFixedDatumRecords;
- }
-
- set
- {
- this._numberOfFixedDatumRecords = value;
- }
- }
-
- ///
- /// Note that setting this value will not change the marshalled value. The list whose length this describes is used for that purpose.
- /// The getnumberOfVariableDatumRecords method will also be based on the actual list length rather than this value.
- /// The method is simply here for completeness and should not be used for any computations.
- ///
- [XmlElement(Type = typeof(uint), ElementName = "numberOfVariableDatumRecords")]
- public uint NumberOfVariableDatumRecords
- {
- get
- {
- return this._numberOfVariableDatumRecords;
- }
-
- set
- {
- this._numberOfVariableDatumRecords = value;
- }
- }
-
- ///
- /// Gets or sets the Fixed datum records
- ///
- [XmlElement(ElementName = "fixedDatumRecordsList", Type = typeof(List))]
- public List FixedDatumRecords
- {
- get
- {
- return this._fixedDatumRecords;
- }
- }
-
- ///
- /// Gets or sets the Variable datum records
- ///
- [XmlElement(ElementName = "variableDatumRecordsList", Type = typeof(List))]
- public List VariableDatumRecords
- {
- get
- {
- return this._variableDatumRecords;
- }
- }
-
- ///
- /// Automatically sets the length of the marshalled data, then calls the marshal method.
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- public override void MarshalAutoLengthSet(DataOutputStream dos)
- {
- // Set the length prior to marshalling data
- this.Length = (ushort)this.GetMarshalledSize();
- this.Marshal(dos);
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Marshal(DataOutputStream dos)
- {
- base.Marshal(dos);
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedInt((uint)this._fixedDatumRecords.Count);
- dos.WriteUnsignedInt((uint)this._variableDatumRecords.Count);
-
- for (int idx = 0; idx < this._fixedDatumRecords.Count; idx++)
- {
- FixedDatum aFixedDatum = (FixedDatum)this._fixedDatumRecords[idx];
- aFixedDatum.Marshal(dos);
- }
-
- for (int idx = 0; idx < this._variableDatumRecords.Count; idx++)
- {
- VariableDatum aVariableDatum = (VariableDatum)this._variableDatumRecords[idx];
- aVariableDatum.Marshal(dos);
- }
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Unmarshal(DataInputStream dis)
- {
- base.Unmarshal(dis);
-
- if (dis != null)
- {
- try
- {
- this._numberOfFixedDatumRecords = dis.ReadUnsignedInt();
- this._numberOfVariableDatumRecords = dis.ReadUnsignedInt();
- for (int idx = 0; idx < this.NumberOfFixedDatumRecords; idx++)
- {
- FixedDatum anX = new FixedDatum();
- anX.Unmarshal(dis);
- this._fixedDatumRecords.Add(anX);
- };
-
- for (int idx = 0; idx < this.NumberOfVariableDatumRecords; idx++)
- {
- VariableDatum anX = new VariableDatum();
- anX.Unmarshal(dis);
- this._variableDatumRecords.Add(anX);
- };
-
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- base.Reflection(sb);
- try
- {
- sb.AppendLine("" + this._fixedDatumRecords.Count.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._variableDatumRecords.Count.ToString(CultureInfo.InvariantCulture) + "");
- for (int idx = 0; idx < this._fixedDatumRecords.Count; idx++)
- {
- sb.AppendLine("");
- FixedDatum aFixedDatum = (FixedDatum)this._fixedDatumRecords[idx];
- aFixedDatum.Reflection(sb);
- sb.AppendLine("");
- }
-
- for (int idx = 0; idx < this._variableDatumRecords.Count; idx++)
- {
- sb.AppendLine("");
- VariableDatum aVariableDatum = (VariableDatum)this._variableDatumRecords[idx];
- aVariableDatum.Reflection(sb);
- sb.AppendLine("");
- }
-
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as CommentReliablePdu;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(CommentReliablePdu obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- ivarsEqual = base.Equals(obj);
-
- if (this._numberOfFixedDatumRecords != obj._numberOfFixedDatumRecords)
- {
- ivarsEqual = false;
- }
-
- if (this._numberOfVariableDatumRecords != obj._numberOfVariableDatumRecords)
- {
- ivarsEqual = false;
- }
-
- if (this._fixedDatumRecords.Count != obj._fixedDatumRecords.Count)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < this._fixedDatumRecords.Count; idx++)
- {
- if (!this._fixedDatumRecords[idx].Equals(obj._fixedDatumRecords[idx]))
- {
- ivarsEqual = false;
- }
- }
- }
-
- if (this._variableDatumRecords.Count != obj._variableDatumRecords.Count)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < this._variableDatumRecords.Count; idx++)
- {
- if (!this._variableDatumRecords[idx].Equals(obj._variableDatumRecords[idx]))
- {
- ivarsEqual = false;
- }
- }
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ base.GetHashCode();
-
- result = GenerateHash(result) ^ this._numberOfFixedDatumRecords.GetHashCode();
- result = GenerateHash(result) ^ this._numberOfVariableDatumRecords.GetHashCode();
-
- if (this._fixedDatumRecords.Count > 0)
- {
- for (int idx = 0; idx < this._fixedDatumRecords.Count; idx++)
- {
- result = GenerateHash(result) ^ this._fixedDatumRecords[idx].GetHashCode();
- }
- }
-
- if (this._variableDatumRecords.Count > 0)
- {
- for (int idx = 0; idx < this._variableDatumRecords.Count; idx++)
- {
- result = GenerateHash(result) ^ this._variableDatumRecords[idx].GetHashCode();
- }
- }
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/CommunicationsNodeID.cs b/tests/OpenDisNet.Reference/Generated/CommunicationsNodeID.cs
deleted file mode 100644
index 4d76215..0000000
--- a/tests/OpenDisNet.Reference/Generated/CommunicationsNodeID.cs
+++ /dev/null
@@ -1,300 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Identity of a communications node. Section 6.2.49.4
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(EntityID))]
- public partial class CommunicationsNodeID
- {
- private EntityID _entityID = new EntityID();
-
- private ushort _elementID;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public CommunicationsNodeID()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(CommunicationsNodeID left, CommunicationsNodeID right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(CommunicationsNodeID left, CommunicationsNodeID right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += this._entityID.GetMarshalledSize(); // this._entityID
- marshalSize += 2; // this._elementID
- return marshalSize;
- }
-
- [XmlElement(Type = typeof(EntityID), ElementName = "entityID")]
- public EntityID EntityID
- {
- get
- {
- return this._entityID;
- }
-
- set
- {
- this._entityID = value;
- }
- }
-
- [XmlElement(Type = typeof(ushort), ElementName = "elementID")]
- public ushort ElementID
- {
- get
- {
- return this._elementID;
- }
-
- set
- {
- this._elementID = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- this._entityID.Marshal(dos);
- dos.WriteUnsignedShort((ushort)this._elementID);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._entityID.Unmarshal(dis);
- this._elementID = dis.ReadUnsignedShort();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("");
- this._entityID.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._elementID.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as CommunicationsNodeID;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(CommunicationsNodeID obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (!this._entityID.Equals(obj._entityID))
- {
- ivarsEqual = false;
- }
-
- if (this._elementID != obj._elementID)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._entityID.GetHashCode();
- result = GenerateHash(result) ^ this._elementID.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/CreateEntityPdu.cs b/tests/OpenDisNet.Reference/Generated/CreateEntityPdu.cs
deleted file mode 100644
index f8a1a5d..0000000
--- a/tests/OpenDisNet.Reference/Generated/CreateEntityPdu.cs
+++ /dev/null
@@ -1,350 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Section 7.5.2. Create a new entity. COMPLETE
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(EntityID))]
- public partial class CreateEntityPdu : SimulationManagementFamilyPdu, IEquatable
- {
- ///
- /// Identifier for the request
- ///
- private EntityID _originatingID = new EntityID();
-
- ///
- /// Identifier for the request
- ///
- private EntityID _receivingID = new EntityID();
-
- ///
- /// Identifier for the request. See 6.2.75
- ///
- private uint _requestID;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public CreateEntityPdu()
- {
- PduType = (byte)11;
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(CreateEntityPdu left, CreateEntityPdu right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(CreateEntityPdu left, CreateEntityPdu right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public override int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize = base.GetMarshalledSize();
- marshalSize += this._originatingID.GetMarshalledSize(); // this._originatingID
- marshalSize += this._receivingID.GetMarshalledSize(); // this._receivingID
- marshalSize += 4; // this._requestID
- return marshalSize;
- }
-
- ///
- /// Gets or sets the Identifier for the request
- ///
- [XmlElement(Type = typeof(EntityID), ElementName = "originatingID")]
- public EntityID OriginatingID
- {
- get
- {
- return this._originatingID;
- }
-
- set
- {
- this._originatingID = value;
- }
- }
-
- ///
- /// Gets or sets the Identifier for the request
- ///
- [XmlElement(Type = typeof(EntityID), ElementName = "receivingID")]
- public EntityID ReceivingID
- {
- get
- {
- return this._receivingID;
- }
-
- set
- {
- this._receivingID = value;
- }
- }
-
- ///
- /// Gets or sets the Identifier for the request. See 6.2.75
- ///
- [XmlElement(Type = typeof(uint), ElementName = "requestID")]
- public uint RequestID
- {
- get
- {
- return this._requestID;
- }
-
- set
- {
- this._requestID = value;
- }
- }
-
- ///
- /// Automatically sets the length of the marshalled data, then calls the marshal method.
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- public override void MarshalAutoLengthSet(DataOutputStream dos)
- {
- // Set the length prior to marshalling data
- this.Length = (ushort)this.GetMarshalledSize();
- this.Marshal(dos);
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Marshal(DataOutputStream dos)
- {
- base.Marshal(dos);
- if (dos != null)
- {
- try
- {
- this._originatingID.Marshal(dos);
- this._receivingID.Marshal(dos);
- dos.WriteUnsignedInt((uint)this._requestID);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Unmarshal(DataInputStream dis)
- {
- base.Unmarshal(dis);
-
- if (dis != null)
- {
- try
- {
- this._originatingID.Unmarshal(dis);
- this._receivingID.Unmarshal(dis);
- this._requestID = dis.ReadUnsignedInt();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- base.Reflection(sb);
- try
- {
- sb.AppendLine("");
- this._originatingID.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- this._receivingID.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._requestID.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as CreateEntityPdu;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(CreateEntityPdu obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- ivarsEqual = base.Equals(obj);
-
- if (!this._originatingID.Equals(obj._originatingID))
- {
- ivarsEqual = false;
- }
-
- if (!this._receivingID.Equals(obj._receivingID))
- {
- ivarsEqual = false;
- }
-
- if (this._requestID != obj._requestID)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ base.GetHashCode();
-
- result = GenerateHash(result) ^ this._originatingID.GetHashCode();
- result = GenerateHash(result) ^ this._receivingID.GetHashCode();
- result = GenerateHash(result) ^ this._requestID.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/CreateEntityReliablePdu.cs b/tests/OpenDisNet.Reference/Generated/CreateEntityReliablePdu.cs
deleted file mode 100644
index b5ab76f..0000000
--- a/tests/OpenDisNet.Reference/Generated/CreateEntityReliablePdu.cs
+++ /dev/null
@@ -1,377 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Section 5.3.12.1: creation of an entity , reliable. COMPLETE
- ///
- [Serializable]
- [XmlRoot]
- public partial class CreateEntityReliablePdu : SimulationManagementWithReliabilityFamilyPdu, IEquatable
- {
- ///
- /// level of reliability service used for this transaction
- ///
- private byte _requiredReliabilityService;
-
- ///
- /// padding
- ///
- private ushort _pad1;
-
- ///
- /// padding
- ///
- private byte _pad2;
-
- ///
- /// Request ID
- ///
- private uint _requestID;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public CreateEntityReliablePdu()
- {
- PduType = (byte)51;
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(CreateEntityReliablePdu left, CreateEntityReliablePdu right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(CreateEntityReliablePdu left, CreateEntityReliablePdu right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public override int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize = base.GetMarshalledSize();
- marshalSize += 1; // this._requiredReliabilityService
- marshalSize += 2; // this._pad1
- marshalSize += 1; // this._pad2
- marshalSize += 4; // this._requestID
- return marshalSize;
- }
-
- ///
- /// Gets or sets the level of reliability service used for this transaction
- ///
- [XmlElement(Type = typeof(byte), ElementName = "requiredReliabilityService")]
- public byte RequiredReliabilityService
- {
- get
- {
- return this._requiredReliabilityService;
- }
-
- set
- {
- this._requiredReliabilityService = value;
- }
- }
-
- ///
- /// Gets or sets the padding
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "pad1")]
- public ushort Pad1
- {
- get
- {
- return this._pad1;
- }
-
- set
- {
- this._pad1 = value;
- }
- }
-
- ///
- /// Gets or sets the padding
- ///
- [XmlElement(Type = typeof(byte), ElementName = "pad2")]
- public byte Pad2
- {
- get
- {
- return this._pad2;
- }
-
- set
- {
- this._pad2 = value;
- }
- }
-
- ///
- /// Gets or sets the Request ID
- ///
- [XmlElement(Type = typeof(uint), ElementName = "requestID")]
- public uint RequestID
- {
- get
- {
- return this._requestID;
- }
-
- set
- {
- this._requestID = value;
- }
- }
-
- ///
- /// Automatically sets the length of the marshalled data, then calls the marshal method.
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- public override void MarshalAutoLengthSet(DataOutputStream dos)
- {
- // Set the length prior to marshalling data
- this.Length = (ushort)this.GetMarshalledSize();
- this.Marshal(dos);
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Marshal(DataOutputStream dos)
- {
- base.Marshal(dos);
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedByte((byte)this._requiredReliabilityService);
- dos.WriteUnsignedShort((ushort)this._pad1);
- dos.WriteUnsignedByte((byte)this._pad2);
- dos.WriteUnsignedInt((uint)this._requestID);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Unmarshal(DataInputStream dis)
- {
- base.Unmarshal(dis);
-
- if (dis != null)
- {
- try
- {
- this._requiredReliabilityService = dis.ReadUnsignedByte();
- this._pad1 = dis.ReadUnsignedShort();
- this._pad2 = dis.ReadUnsignedByte();
- this._requestID = dis.ReadUnsignedInt();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- base.Reflection(sb);
- try
- {
- sb.AppendLine("" + this._requiredReliabilityService.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._pad1.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._pad2.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._requestID.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as CreateEntityReliablePdu;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(CreateEntityReliablePdu obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- ivarsEqual = base.Equals(obj);
-
- if (this._requiredReliabilityService != obj._requiredReliabilityService)
- {
- ivarsEqual = false;
- }
-
- if (this._pad1 != obj._pad1)
- {
- ivarsEqual = false;
- }
-
- if (this._pad2 != obj._pad2)
- {
- ivarsEqual = false;
- }
-
- if (this._requestID != obj._requestID)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ base.GetHashCode();
-
- result = GenerateHash(result) ^ this._requiredReliabilityService.GetHashCode();
- result = GenerateHash(result) ^ this._pad1.GetHashCode();
- result = GenerateHash(result) ^ this._pad2.GetHashCode();
- result = GenerateHash(result) ^ this._requestID.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/DataPdu.cs b/tests/OpenDisNet.Reference/Generated/DataPdu.cs
deleted file mode 100644
index 5586918..0000000
--- a/tests/OpenDisNet.Reference/Generated/DataPdu.cs
+++ /dev/null
@@ -1,519 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Information issued in response to a data query pdu or a set data pdu is communicated using a data pdu. Section 7.5.11 COMPLETE
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(FixedDatum))]
- [XmlInclude(typeof(VariableDatum))]
- public partial class DataPdu : SimulationManagementFamilyPdu, IEquatable
- {
- ///
- /// ID of request
- ///
- private uint _requestID;
-
- ///
- /// padding
- ///
- private uint _padding1;
-
- ///
- /// Number of fixed datum records
- ///
- private uint _numberOfFixedDatumRecords;
-
- ///
- /// Number of variable datum records
- ///
- private uint _numberOfVariableDatumRecords;
-
- ///
- /// variable length list of fixed datums
- ///
- private List _fixedDatums = new List();
-
- ///
- /// variable length list of variable length datums
- ///
- private List _variableDatums = new List();
-
- ///
- /// Initializes a new instance of the class.
- ///
- public DataPdu()
- {
- PduType = (byte)20;
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(DataPdu left, DataPdu right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(DataPdu left, DataPdu right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public override int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize = base.GetMarshalledSize();
- marshalSize += 4; // this._requestID
- marshalSize += 4; // this._padding1
- marshalSize += 4; // this._numberOfFixedDatumRecords
- marshalSize += 4; // this._numberOfVariableDatumRecords
- for (int idx = 0; idx < this._fixedDatums.Count; idx++)
- {
- FixedDatum listElement = (FixedDatum)this._fixedDatums[idx];
- marshalSize += listElement.GetMarshalledSize();
- }
-
- for (int idx = 0; idx < this._variableDatums.Count; idx++)
- {
- VariableDatum listElement = (VariableDatum)this._variableDatums[idx];
- marshalSize += listElement.GetMarshalledSize();
- }
-
- return marshalSize;
- }
-
- ///
- /// Gets or sets the ID of request
- ///
- [XmlElement(Type = typeof(uint), ElementName = "requestID")]
- public uint RequestID
- {
- get
- {
- return this._requestID;
- }
-
- set
- {
- this._requestID = value;
- }
- }
-
- ///
- /// Gets or sets the padding
- ///
- [XmlElement(Type = typeof(uint), ElementName = "padding1")]
- public uint Padding1
- {
- get
- {
- return this._padding1;
- }
-
- set
- {
- this._padding1 = value;
- }
- }
-
- ///
- /// Note that setting this value will not change the marshalled value. The list whose length this describes is used for that purpose.
- /// The getnumberOfFixedDatumRecords method will also be based on the actual list length rather than this value.
- /// The method is simply here for completeness and should not be used for any computations.
- ///
- [XmlElement(Type = typeof(uint), ElementName = "numberOfFixedDatumRecords")]
- public uint NumberOfFixedDatumRecords
- {
- get
- {
- return this._numberOfFixedDatumRecords;
- }
-
- set
- {
- this._numberOfFixedDatumRecords = value;
- }
- }
-
- ///
- /// Note that setting this value will not change the marshalled value. The list whose length this describes is used for that purpose.
- /// The getnumberOfVariableDatumRecords method will also be based on the actual list length rather than this value.
- /// The method is simply here for completeness and should not be used for any computations.
- ///
- [XmlElement(Type = typeof(uint), ElementName = "numberOfVariableDatumRecords")]
- public uint NumberOfVariableDatumRecords
- {
- get
- {
- return this._numberOfVariableDatumRecords;
- }
-
- set
- {
- this._numberOfVariableDatumRecords = value;
- }
- }
-
- ///
- /// Gets or sets the variable length list of fixed datums
- ///
- [XmlElement(ElementName = "fixedDatumsList", Type = typeof(List))]
- public List FixedDatums
- {
- get
- {
- return this._fixedDatums;
- }
- }
-
- ///
- /// Gets or sets the variable length list of variable length datums
- ///
- [XmlElement(ElementName = "variableDatumsList", Type = typeof(List))]
- public List VariableDatums
- {
- get
- {
- return this._variableDatums;
- }
- }
-
- ///
- /// Automatically sets the length of the marshalled data, then calls the marshal method.
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- public override void MarshalAutoLengthSet(DataOutputStream dos)
- {
- // Set the length prior to marshalling data
- this.Length = (ushort)this.GetMarshalledSize();
- this.Marshal(dos);
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Marshal(DataOutputStream dos)
- {
- base.Marshal(dos);
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedInt((uint)this._requestID);
- dos.WriteUnsignedInt((uint)this._padding1);
- dos.WriteUnsignedInt((uint)this._fixedDatums.Count);
- dos.WriteUnsignedInt((uint)this._variableDatums.Count);
-
- for (int idx = 0; idx < this._fixedDatums.Count; idx++)
- {
- FixedDatum aFixedDatum = (FixedDatum)this._fixedDatums[idx];
- aFixedDatum.Marshal(dos);
- }
-
- for (int idx = 0; idx < this._variableDatums.Count; idx++)
- {
- VariableDatum aVariableDatum = (VariableDatum)this._variableDatums[idx];
- aVariableDatum.Marshal(dos);
- }
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Unmarshal(DataInputStream dis)
- {
- base.Unmarshal(dis);
-
- if (dis != null)
- {
- try
- {
- this._requestID = dis.ReadUnsignedInt();
- this._padding1 = dis.ReadUnsignedInt();
- this._numberOfFixedDatumRecords = dis.ReadUnsignedInt();
- this._numberOfVariableDatumRecords = dis.ReadUnsignedInt();
- for (int idx = 0; idx < this.NumberOfFixedDatumRecords; idx++)
- {
- FixedDatum anX = new FixedDatum();
- anX.Unmarshal(dis);
- this._fixedDatums.Add(anX);
- };
-
- for (int idx = 0; idx < this.NumberOfVariableDatumRecords; idx++)
- {
- VariableDatum anX = new VariableDatum();
- anX.Unmarshal(dis);
- this._variableDatums.Add(anX);
- };
-
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- base.Reflection(sb);
- try
- {
- sb.AppendLine("" + this._requestID.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._padding1.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._fixedDatums.Count.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._variableDatums.Count.ToString(CultureInfo.InvariantCulture) + "");
- for (int idx = 0; idx < this._fixedDatums.Count; idx++)
- {
- sb.AppendLine("");
- FixedDatum aFixedDatum = (FixedDatum)this._fixedDatums[idx];
- aFixedDatum.Reflection(sb);
- sb.AppendLine("");
- }
-
- for (int idx = 0; idx < this._variableDatums.Count; idx++)
- {
- sb.AppendLine("");
- VariableDatum aVariableDatum = (VariableDatum)this._variableDatums[idx];
- aVariableDatum.Reflection(sb);
- sb.AppendLine("");
- }
-
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as DataPdu;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(DataPdu obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- ivarsEqual = base.Equals(obj);
-
- if (this._requestID != obj._requestID)
- {
- ivarsEqual = false;
- }
-
- if (this._padding1 != obj._padding1)
- {
- ivarsEqual = false;
- }
-
- if (this._numberOfFixedDatumRecords != obj._numberOfFixedDatumRecords)
- {
- ivarsEqual = false;
- }
-
- if (this._numberOfVariableDatumRecords != obj._numberOfVariableDatumRecords)
- {
- ivarsEqual = false;
- }
-
- if (this._fixedDatums.Count != obj._fixedDatums.Count)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < this._fixedDatums.Count; idx++)
- {
- if (!this._fixedDatums[idx].Equals(obj._fixedDatums[idx]))
- {
- ivarsEqual = false;
- }
- }
- }
-
- if (this._variableDatums.Count != obj._variableDatums.Count)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < this._variableDatums.Count; idx++)
- {
- if (!this._variableDatums[idx].Equals(obj._variableDatums[idx]))
- {
- ivarsEqual = false;
- }
- }
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ base.GetHashCode();
-
- result = GenerateHash(result) ^ this._requestID.GetHashCode();
- result = GenerateHash(result) ^ this._padding1.GetHashCode();
- result = GenerateHash(result) ^ this._numberOfFixedDatumRecords.GetHashCode();
- result = GenerateHash(result) ^ this._numberOfVariableDatumRecords.GetHashCode();
-
- if (this._fixedDatums.Count > 0)
- {
- for (int idx = 0; idx < this._fixedDatums.Count; idx++)
- {
- result = GenerateHash(result) ^ this._fixedDatums[idx].GetHashCode();
- }
- }
-
- if (this._variableDatums.Count > 0)
- {
- for (int idx = 0; idx < this._variableDatums.Count; idx++)
- {
- result = GenerateHash(result) ^ this._variableDatums[idx].GetHashCode();
- }
- }
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/DataQueryDatumSpecification.cs b/tests/OpenDisNet.Reference/Generated/DataQueryDatumSpecification.cs
deleted file mode 100644
index d2d4ef0..0000000
--- a/tests/OpenDisNet.Reference/Generated/DataQueryDatumSpecification.cs
+++ /dev/null
@@ -1,451 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// List of fixed and variable datum records. Section 6.2.18
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(UnsignedDISInteger))]
- [XmlInclude(typeof(UnsignedDISInteger))]
- public partial class DataQueryDatumSpecification
- {
- ///
- /// Number of fixed datums
- ///
- private uint _numberOfFixedDatums;
-
- ///
- /// Number of variable datums
- ///
- private uint _numberOfVariableDatums;
-
- ///
- /// variable length list fixed datum IDs
- ///
- private List _fixedDatumIDList = new List();
-
- ///
- /// variable length list variable datum IDs
- ///
- private List _variableDatumIDList = new List();
-
- ///
- /// Initializes a new instance of the class.
- ///
- public DataQueryDatumSpecification()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(DataQueryDatumSpecification left, DataQueryDatumSpecification right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(DataQueryDatumSpecification left, DataQueryDatumSpecification right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += 4; // this._numberOfFixedDatums
- marshalSize += 4; // this._numberOfVariableDatums
- for (int idx = 0; idx < this._fixedDatumIDList.Count; idx++)
- {
- UnsignedDISInteger listElement = (UnsignedDISInteger)this._fixedDatumIDList[idx];
- marshalSize += listElement.GetMarshalledSize();
- }
-
- for (int idx = 0; idx < this._variableDatumIDList.Count; idx++)
- {
- UnsignedDISInteger listElement = (UnsignedDISInteger)this._variableDatumIDList[idx];
- marshalSize += listElement.GetMarshalledSize();
- }
-
- return marshalSize;
- }
-
- ///
- /// Note that setting this value will not change the marshalled value. The list whose length this describes is used for that purpose.
- /// The getnumberOfFixedDatums method will also be based on the actual list length rather than this value.
- /// The method is simply here for completeness and should not be used for any computations.
- ///
- [XmlElement(Type = typeof(uint), ElementName = "numberOfFixedDatums")]
- public uint NumberOfFixedDatums
- {
- get
- {
- return this._numberOfFixedDatums;
- }
-
- set
- {
- this._numberOfFixedDatums = value;
- }
- }
-
- ///
- /// Note that setting this value will not change the marshalled value. The list whose length this describes is used for that purpose.
- /// The getnumberOfVariableDatums method will also be based on the actual list length rather than this value.
- /// The method is simply here for completeness and should not be used for any computations.
- ///
- [XmlElement(Type = typeof(uint), ElementName = "numberOfVariableDatums")]
- public uint NumberOfVariableDatums
- {
- get
- {
- return this._numberOfVariableDatums;
- }
-
- set
- {
- this._numberOfVariableDatums = value;
- }
- }
-
- ///
- /// Gets or sets the variable length list fixed datum IDs
- ///
- [XmlElement(ElementName = "fixedDatumIDListList", Type = typeof(List))]
- public List FixedDatumIDList
- {
- get
- {
- return this._fixedDatumIDList;
- }
- }
-
- ///
- /// Gets or sets the variable length list variable datum IDs
- ///
- [XmlElement(ElementName = "variableDatumIDListList", Type = typeof(List))]
- public List VariableDatumIDList
- {
- get
- {
- return this._variableDatumIDList;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedInt((uint)this._fixedDatumIDList.Count);
- dos.WriteUnsignedInt((uint)this._variableDatumIDList.Count);
-
- for (int idx = 0; idx < this._fixedDatumIDList.Count; idx++)
- {
- UnsignedDISInteger aUnsignedDISInteger = (UnsignedDISInteger)this._fixedDatumIDList[idx];
- aUnsignedDISInteger.Marshal(dos);
- }
-
- for (int idx = 0; idx < this._variableDatumIDList.Count; idx++)
- {
- UnsignedDISInteger aUnsignedDISInteger = (UnsignedDISInteger)this._variableDatumIDList[idx];
- aUnsignedDISInteger.Marshal(dos);
- }
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._numberOfFixedDatums = dis.ReadUnsignedInt();
- this._numberOfVariableDatums = dis.ReadUnsignedInt();
- for (int idx = 0; idx < this.NumberOfFixedDatums; idx++)
- {
- UnsignedDISInteger anX = new UnsignedDISInteger();
- anX.Unmarshal(dis);
- this._fixedDatumIDList.Add(anX);
- };
-
- for (int idx = 0; idx < this.NumberOfVariableDatums; idx++)
- {
- UnsignedDISInteger anX = new UnsignedDISInteger();
- anX.Unmarshal(dis);
- this._variableDatumIDList.Add(anX);
- };
-
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("" + this._fixedDatumIDList.Count.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._variableDatumIDList.Count.ToString(CultureInfo.InvariantCulture) + "");
- for (int idx = 0; idx < this._fixedDatumIDList.Count; idx++)
- {
- sb.AppendLine("");
- UnsignedDISInteger aUnsignedDISInteger = (UnsignedDISInteger)this._fixedDatumIDList[idx];
- aUnsignedDISInteger.Reflection(sb);
- sb.AppendLine("");
- }
-
- for (int idx = 0; idx < this._variableDatumIDList.Count; idx++)
- {
- sb.AppendLine("");
- UnsignedDISInteger aUnsignedDISInteger = (UnsignedDISInteger)this._variableDatumIDList[idx];
- aUnsignedDISInteger.Reflection(sb);
- sb.AppendLine("");
- }
-
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as DataQueryDatumSpecification;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(DataQueryDatumSpecification obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (this._numberOfFixedDatums != obj._numberOfFixedDatums)
- {
- ivarsEqual = false;
- }
-
- if (this._numberOfVariableDatums != obj._numberOfVariableDatums)
- {
- ivarsEqual = false;
- }
-
- if (this._fixedDatumIDList.Count != obj._fixedDatumIDList.Count)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < this._fixedDatumIDList.Count; idx++)
- {
- if (!this._fixedDatumIDList[idx].Equals(obj._fixedDatumIDList[idx]))
- {
- ivarsEqual = false;
- }
- }
- }
-
- if (this._variableDatumIDList.Count != obj._variableDatumIDList.Count)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < this._variableDatumIDList.Count; idx++)
- {
- if (!this._variableDatumIDList[idx].Equals(obj._variableDatumIDList[idx]))
- {
- ivarsEqual = false;
- }
- }
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._numberOfFixedDatums.GetHashCode();
- result = GenerateHash(result) ^ this._numberOfVariableDatums.GetHashCode();
-
- if (this._fixedDatumIDList.Count > 0)
- {
- for (int idx = 0; idx < this._fixedDatumIDList.Count; idx++)
- {
- result = GenerateHash(result) ^ this._fixedDatumIDList[idx].GetHashCode();
- }
- }
-
- if (this._variableDatumIDList.Count > 0)
- {
- for (int idx = 0; idx < this._variableDatumIDList.Count; idx++)
- {
- result = GenerateHash(result) ^ this._variableDatumIDList[idx].GetHashCode();
- }
- }
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/DataQueryPdu.cs b/tests/OpenDisNet.Reference/Generated/DataQueryPdu.cs
deleted file mode 100644
index 619fb99..0000000
--- a/tests/OpenDisNet.Reference/Generated/DataQueryPdu.cs
+++ /dev/null
@@ -1,519 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Section 7.5.9. Request for data from an entity. COMPLETE
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(FixedDatum))]
- [XmlInclude(typeof(VariableDatum))]
- public partial class DataQueryPdu : SimulationManagementFamilyPdu, IEquatable
- {
- ///
- /// ID of request
- ///
- private uint _requestID;
-
- ///
- /// time issues between issues of Data PDUs. Zero means send once only.
- ///
- private uint _timeInterval;
-
- ///
- /// Number of fixed datum records
- ///
- private uint _numberOfFixedDatumRecords;
-
- ///
- /// Number of variable datum records
- ///
- private uint _numberOfVariableDatumRecords;
-
- ///
- /// variable length list of fixed datums
- ///
- private List _fixedDatums = new List();
-
- ///
- /// variable length list of variable length datums
- ///
- private List _variableDatums = new List();
-
- ///
- /// Initializes a new instance of the class.
- ///
- public DataQueryPdu()
- {
- PduType = (byte)18;
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(DataQueryPdu left, DataQueryPdu right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(DataQueryPdu left, DataQueryPdu right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public override int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize = base.GetMarshalledSize();
- marshalSize += 4; // this._requestID
- marshalSize += 4; // this._timeInterval
- marshalSize += 4; // this._numberOfFixedDatumRecords
- marshalSize += 4; // this._numberOfVariableDatumRecords
- for (int idx = 0; idx < this._fixedDatums.Count; idx++)
- {
- FixedDatum listElement = (FixedDatum)this._fixedDatums[idx];
- marshalSize += listElement.GetMarshalledSize();
- }
-
- for (int idx = 0; idx < this._variableDatums.Count; idx++)
- {
- VariableDatum listElement = (VariableDatum)this._variableDatums[idx];
- marshalSize += listElement.GetMarshalledSize();
- }
-
- return marshalSize;
- }
-
- ///
- /// Gets or sets the ID of request
- ///
- [XmlElement(Type = typeof(uint), ElementName = "requestID")]
- public uint RequestID
- {
- get
- {
- return this._requestID;
- }
-
- set
- {
- this._requestID = value;
- }
- }
-
- ///
- /// Gets or sets the time issues between issues of Data PDUs. Zero means send once only.
- ///
- [XmlElement(Type = typeof(uint), ElementName = "timeInterval")]
- public uint TimeInterval
- {
- get
- {
- return this._timeInterval;
- }
-
- set
- {
- this._timeInterval = value;
- }
- }
-
- ///
- /// Note that setting this value will not change the marshalled value. The list whose length this describes is used for that purpose.
- /// The getnumberOfFixedDatumRecords method will also be based on the actual list length rather than this value.
- /// The method is simply here for completeness and should not be used for any computations.
- ///
- [XmlElement(Type = typeof(uint), ElementName = "numberOfFixedDatumRecords")]
- public uint NumberOfFixedDatumRecords
- {
- get
- {
- return this._numberOfFixedDatumRecords;
- }
-
- set
- {
- this._numberOfFixedDatumRecords = value;
- }
- }
-
- ///
- /// Note that setting this value will not change the marshalled value. The list whose length this describes is used for that purpose.
- /// The getnumberOfVariableDatumRecords method will also be based on the actual list length rather than this value.
- /// The method is simply here for completeness and should not be used for any computations.
- ///
- [XmlElement(Type = typeof(uint), ElementName = "numberOfVariableDatumRecords")]
- public uint NumberOfVariableDatumRecords
- {
- get
- {
- return this._numberOfVariableDatumRecords;
- }
-
- set
- {
- this._numberOfVariableDatumRecords = value;
- }
- }
-
- ///
- /// Gets or sets the variable length list of fixed datums
- ///
- [XmlElement(ElementName = "fixedDatumsList", Type = typeof(List))]
- public List FixedDatums
- {
- get
- {
- return this._fixedDatums;
- }
- }
-
- ///
- /// Gets or sets the variable length list of variable length datums
- ///
- [XmlElement(ElementName = "variableDatumsList", Type = typeof(List))]
- public List VariableDatums
- {
- get
- {
- return this._variableDatums;
- }
- }
-
- ///
- /// Automatically sets the length of the marshalled data, then calls the marshal method.
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- public override void MarshalAutoLengthSet(DataOutputStream dos)
- {
- // Set the length prior to marshalling data
- this.Length = (ushort)this.GetMarshalledSize();
- this.Marshal(dos);
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Marshal(DataOutputStream dos)
- {
- base.Marshal(dos);
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedInt((uint)this._requestID);
- dos.WriteUnsignedInt((uint)this._timeInterval);
- dos.WriteUnsignedInt((uint)this._fixedDatums.Count);
- dos.WriteUnsignedInt((uint)this._variableDatums.Count);
-
- for (int idx = 0; idx < this._fixedDatums.Count; idx++)
- {
- FixedDatum aFixedDatum = (FixedDatum)this._fixedDatums[idx];
- aFixedDatum.Marshal(dos);
- }
-
- for (int idx = 0; idx < this._variableDatums.Count; idx++)
- {
- VariableDatum aVariableDatum = (VariableDatum)this._variableDatums[idx];
- aVariableDatum.Marshal(dos);
- }
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Unmarshal(DataInputStream dis)
- {
- base.Unmarshal(dis);
-
- if (dis != null)
- {
- try
- {
- this._requestID = dis.ReadUnsignedInt();
- this._timeInterval = dis.ReadUnsignedInt();
- this._numberOfFixedDatumRecords = dis.ReadUnsignedInt();
- this._numberOfVariableDatumRecords = dis.ReadUnsignedInt();
- for (int idx = 0; idx < this.NumberOfFixedDatumRecords; idx++)
- {
- FixedDatum anX = new FixedDatum();
- anX.Unmarshal(dis);
- this._fixedDatums.Add(anX);
- };
-
- for (int idx = 0; idx < this.NumberOfVariableDatumRecords; idx++)
- {
- VariableDatum anX = new VariableDatum();
- anX.Unmarshal(dis);
- this._variableDatums.Add(anX);
- };
-
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- base.Reflection(sb);
- try
- {
- sb.AppendLine("" + this._requestID.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._timeInterval.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._fixedDatums.Count.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._variableDatums.Count.ToString(CultureInfo.InvariantCulture) + "");
- for (int idx = 0; idx < this._fixedDatums.Count; idx++)
- {
- sb.AppendLine("");
- FixedDatum aFixedDatum = (FixedDatum)this._fixedDatums[idx];
- aFixedDatum.Reflection(sb);
- sb.AppendLine("");
- }
-
- for (int idx = 0; idx < this._variableDatums.Count; idx++)
- {
- sb.AppendLine("");
- VariableDatum aVariableDatum = (VariableDatum)this._variableDatums[idx];
- aVariableDatum.Reflection(sb);
- sb.AppendLine("");
- }
-
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as DataQueryPdu;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(DataQueryPdu obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- ivarsEqual = base.Equals(obj);
-
- if (this._requestID != obj._requestID)
- {
- ivarsEqual = false;
- }
-
- if (this._timeInterval != obj._timeInterval)
- {
- ivarsEqual = false;
- }
-
- if (this._numberOfFixedDatumRecords != obj._numberOfFixedDatumRecords)
- {
- ivarsEqual = false;
- }
-
- if (this._numberOfVariableDatumRecords != obj._numberOfVariableDatumRecords)
- {
- ivarsEqual = false;
- }
-
- if (this._fixedDatums.Count != obj._fixedDatums.Count)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < this._fixedDatums.Count; idx++)
- {
- if (!this._fixedDatums[idx].Equals(obj._fixedDatums[idx]))
- {
- ivarsEqual = false;
- }
- }
- }
-
- if (this._variableDatums.Count != obj._variableDatums.Count)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < this._variableDatums.Count; idx++)
- {
- if (!this._variableDatums[idx].Equals(obj._variableDatums[idx]))
- {
- ivarsEqual = false;
- }
- }
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ base.GetHashCode();
-
- result = GenerateHash(result) ^ this._requestID.GetHashCode();
- result = GenerateHash(result) ^ this._timeInterval.GetHashCode();
- result = GenerateHash(result) ^ this._numberOfFixedDatumRecords.GetHashCode();
- result = GenerateHash(result) ^ this._numberOfVariableDatumRecords.GetHashCode();
-
- if (this._fixedDatums.Count > 0)
- {
- for (int idx = 0; idx < this._fixedDatums.Count; idx++)
- {
- result = GenerateHash(result) ^ this._fixedDatums[idx].GetHashCode();
- }
- }
-
- if (this._variableDatums.Count > 0)
- {
- for (int idx = 0; idx < this._variableDatums.Count; idx++)
- {
- result = GenerateHash(result) ^ this._variableDatums[idx].GetHashCode();
- }
- }
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/DataQueryReliablePdu.cs b/tests/OpenDisNet.Reference/Generated/DataQueryReliablePdu.cs
deleted file mode 100644
index 715efb2..0000000
--- a/tests/OpenDisNet.Reference/Generated/DataQueryReliablePdu.cs
+++ /dev/null
@@ -1,615 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Section 5.3.12.8: request for data from an entity. COMPLETE
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(FixedDatum))]
- [XmlInclude(typeof(VariableDatum))]
- public partial class DataQueryReliablePdu : SimulationManagementWithReliabilityFamilyPdu, IEquatable
- {
- ///
- /// level of reliability service used for this transaction
- ///
- private byte _requiredReliabilityService;
-
- ///
- /// padding
- ///
- private ushort _pad1;
-
- ///
- /// padding
- ///
- private byte _pad2;
-
- ///
- /// request ID
- ///
- private uint _requestID;
-
- ///
- /// time interval between issuing data query PDUs
- ///
- private uint _timeInterval;
-
- ///
- /// Fixed datum record count
- ///
- private uint _numberOfFixedDatumRecords;
-
- ///
- /// variable datum record count
- ///
- private uint _numberOfVariableDatumRecords;
-
- ///
- /// Fixed datum records
- ///
- private List _fixedDatumRecords = new List();
-
- ///
- /// Variable datum records
- ///
- private List _variableDatumRecords = new List();
-
- ///
- /// Initializes a new instance of the class.
- ///
- public DataQueryReliablePdu()
- {
- PduType = (byte)58;
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(DataQueryReliablePdu left, DataQueryReliablePdu right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(DataQueryReliablePdu left, DataQueryReliablePdu right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public override int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize = base.GetMarshalledSize();
- marshalSize += 1; // this._requiredReliabilityService
- marshalSize += 2; // this._pad1
- marshalSize += 1; // this._pad2
- marshalSize += 4; // this._requestID
- marshalSize += 4; // this._timeInterval
- marshalSize += 4; // this._numberOfFixedDatumRecords
- marshalSize += 4; // this._numberOfVariableDatumRecords
- for (int idx = 0; idx < this._fixedDatumRecords.Count; idx++)
- {
- FixedDatum listElement = (FixedDatum)this._fixedDatumRecords[idx];
- marshalSize += listElement.GetMarshalledSize();
- }
-
- for (int idx = 0; idx < this._variableDatumRecords.Count; idx++)
- {
- VariableDatum listElement = (VariableDatum)this._variableDatumRecords[idx];
- marshalSize += listElement.GetMarshalledSize();
- }
-
- return marshalSize;
- }
-
- ///
- /// Gets or sets the level of reliability service used for this transaction
- ///
- [XmlElement(Type = typeof(byte), ElementName = "requiredReliabilityService")]
- public byte RequiredReliabilityService
- {
- get
- {
- return this._requiredReliabilityService;
- }
-
- set
- {
- this._requiredReliabilityService = value;
- }
- }
-
- ///
- /// Gets or sets the padding
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "pad1")]
- public ushort Pad1
- {
- get
- {
- return this._pad1;
- }
-
- set
- {
- this._pad1 = value;
- }
- }
-
- ///
- /// Gets or sets the padding
- ///
- [XmlElement(Type = typeof(byte), ElementName = "pad2")]
- public byte Pad2
- {
- get
- {
- return this._pad2;
- }
-
- set
- {
- this._pad2 = value;
- }
- }
-
- ///
- /// Gets or sets the request ID
- ///
- [XmlElement(Type = typeof(uint), ElementName = "requestID")]
- public uint RequestID
- {
- get
- {
- return this._requestID;
- }
-
- set
- {
- this._requestID = value;
- }
- }
-
- ///
- /// Gets or sets the time interval between issuing data query PDUs
- ///
- [XmlElement(Type = typeof(uint), ElementName = "timeInterval")]
- public uint TimeInterval
- {
- get
- {
- return this._timeInterval;
- }
-
- set
- {
- this._timeInterval = value;
- }
- }
-
- ///
- /// Note that setting this value will not change the marshalled value. The list whose length this describes is used for that purpose.
- /// The getnumberOfFixedDatumRecords method will also be based on the actual list length rather than this value.
- /// The method is simply here for completeness and should not be used for any computations.
- ///
- [XmlElement(Type = typeof(uint), ElementName = "numberOfFixedDatumRecords")]
- public uint NumberOfFixedDatumRecords
- {
- get
- {
- return this._numberOfFixedDatumRecords;
- }
-
- set
- {
- this._numberOfFixedDatumRecords = value;
- }
- }
-
- ///
- /// Note that setting this value will not change the marshalled value. The list whose length this describes is used for that purpose.
- /// The getnumberOfVariableDatumRecords method will also be based on the actual list length rather than this value.
- /// The method is simply here for completeness and should not be used for any computations.
- ///
- [XmlElement(Type = typeof(uint), ElementName = "numberOfVariableDatumRecords")]
- public uint NumberOfVariableDatumRecords
- {
- get
- {
- return this._numberOfVariableDatumRecords;
- }
-
- set
- {
- this._numberOfVariableDatumRecords = value;
- }
- }
-
- ///
- /// Gets or sets the Fixed datum records
- ///
- [XmlElement(ElementName = "fixedDatumRecordsList", Type = typeof(List))]
- public List FixedDatumRecords
- {
- get
- {
- return this._fixedDatumRecords;
- }
- }
-
- ///
- /// Gets or sets the Variable datum records
- ///
- [XmlElement(ElementName = "variableDatumRecordsList", Type = typeof(List))]
- public List VariableDatumRecords
- {
- get
- {
- return this._variableDatumRecords;
- }
- }
-
- ///
- /// Automatically sets the length of the marshalled data, then calls the marshal method.
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- public override void MarshalAutoLengthSet(DataOutputStream dos)
- {
- // Set the length prior to marshalling data
- this.Length = (ushort)this.GetMarshalledSize();
- this.Marshal(dos);
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Marshal(DataOutputStream dos)
- {
- base.Marshal(dos);
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedByte((byte)this._requiredReliabilityService);
- dos.WriteUnsignedShort((ushort)this._pad1);
- dos.WriteUnsignedByte((byte)this._pad2);
- dos.WriteUnsignedInt((uint)this._requestID);
- dos.WriteUnsignedInt((uint)this._timeInterval);
- dos.WriteUnsignedInt((uint)this._fixedDatumRecords.Count);
- dos.WriteUnsignedInt((uint)this._variableDatumRecords.Count);
-
- for (int idx = 0; idx < this._fixedDatumRecords.Count; idx++)
- {
- FixedDatum aFixedDatum = (FixedDatum)this._fixedDatumRecords[idx];
- aFixedDatum.Marshal(dos);
- }
-
- for (int idx = 0; idx < this._variableDatumRecords.Count; idx++)
- {
- VariableDatum aVariableDatum = (VariableDatum)this._variableDatumRecords[idx];
- aVariableDatum.Marshal(dos);
- }
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Unmarshal(DataInputStream dis)
- {
- base.Unmarshal(dis);
-
- if (dis != null)
- {
- try
- {
- this._requiredReliabilityService = dis.ReadUnsignedByte();
- this._pad1 = dis.ReadUnsignedShort();
- this._pad2 = dis.ReadUnsignedByte();
- this._requestID = dis.ReadUnsignedInt();
- this._timeInterval = dis.ReadUnsignedInt();
- this._numberOfFixedDatumRecords = dis.ReadUnsignedInt();
- this._numberOfVariableDatumRecords = dis.ReadUnsignedInt();
- for (int idx = 0; idx < this.NumberOfFixedDatumRecords; idx++)
- {
- FixedDatum anX = new FixedDatum();
- anX.Unmarshal(dis);
- this._fixedDatumRecords.Add(anX);
- };
-
- for (int idx = 0; idx < this.NumberOfVariableDatumRecords; idx++)
- {
- VariableDatum anX = new VariableDatum();
- anX.Unmarshal(dis);
- this._variableDatumRecords.Add(anX);
- };
-
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- base.Reflection(sb);
- try
- {
- sb.AppendLine("" + this._requiredReliabilityService.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._pad1.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._pad2.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._requestID.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._timeInterval.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._fixedDatumRecords.Count.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._variableDatumRecords.Count.ToString(CultureInfo.InvariantCulture) + "");
- for (int idx = 0; idx < this._fixedDatumRecords.Count; idx++)
- {
- sb.AppendLine("");
- FixedDatum aFixedDatum = (FixedDatum)this._fixedDatumRecords[idx];
- aFixedDatum.Reflection(sb);
- sb.AppendLine("");
- }
-
- for (int idx = 0; idx < this._variableDatumRecords.Count; idx++)
- {
- sb.AppendLine("");
- VariableDatum aVariableDatum = (VariableDatum)this._variableDatumRecords[idx];
- aVariableDatum.Reflection(sb);
- sb.AppendLine("");
- }
-
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as DataQueryReliablePdu;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(DataQueryReliablePdu obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- ivarsEqual = base.Equals(obj);
-
- if (this._requiredReliabilityService != obj._requiredReliabilityService)
- {
- ivarsEqual = false;
- }
-
- if (this._pad1 != obj._pad1)
- {
- ivarsEqual = false;
- }
-
- if (this._pad2 != obj._pad2)
- {
- ivarsEqual = false;
- }
-
- if (this._requestID != obj._requestID)
- {
- ivarsEqual = false;
- }
-
- if (this._timeInterval != obj._timeInterval)
- {
- ivarsEqual = false;
- }
-
- if (this._numberOfFixedDatumRecords != obj._numberOfFixedDatumRecords)
- {
- ivarsEqual = false;
- }
-
- if (this._numberOfVariableDatumRecords != obj._numberOfVariableDatumRecords)
- {
- ivarsEqual = false;
- }
-
- if (this._fixedDatumRecords.Count != obj._fixedDatumRecords.Count)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < this._fixedDatumRecords.Count; idx++)
- {
- if (!this._fixedDatumRecords[idx].Equals(obj._fixedDatumRecords[idx]))
- {
- ivarsEqual = false;
- }
- }
- }
-
- if (this._variableDatumRecords.Count != obj._variableDatumRecords.Count)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < this._variableDatumRecords.Count; idx++)
- {
- if (!this._variableDatumRecords[idx].Equals(obj._variableDatumRecords[idx]))
- {
- ivarsEqual = false;
- }
- }
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ base.GetHashCode();
-
- result = GenerateHash(result) ^ this._requiredReliabilityService.GetHashCode();
- result = GenerateHash(result) ^ this._pad1.GetHashCode();
- result = GenerateHash(result) ^ this._pad2.GetHashCode();
- result = GenerateHash(result) ^ this._requestID.GetHashCode();
- result = GenerateHash(result) ^ this._timeInterval.GetHashCode();
- result = GenerateHash(result) ^ this._numberOfFixedDatumRecords.GetHashCode();
- result = GenerateHash(result) ^ this._numberOfVariableDatumRecords.GetHashCode();
-
- if (this._fixedDatumRecords.Count > 0)
- {
- for (int idx = 0; idx < this._fixedDatumRecords.Count; idx++)
- {
- result = GenerateHash(result) ^ this._fixedDatumRecords[idx].GetHashCode();
- }
- }
-
- if (this._variableDatumRecords.Count > 0)
- {
- for (int idx = 0; idx < this._variableDatumRecords.Count; idx++)
- {
- result = GenerateHash(result) ^ this._variableDatumRecords[idx].GetHashCode();
- }
- }
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/DataReliablePdu.cs b/tests/OpenDisNet.Reference/Generated/DataReliablePdu.cs
deleted file mode 100644
index 02100a4..0000000
--- a/tests/OpenDisNet.Reference/Generated/DataReliablePdu.cs
+++ /dev/null
@@ -1,583 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Section 5.3.12.10: issued in response to a data query R or set dataR pdu. Needs manual intervention to fix padding on variable datums. UNFINSIHED
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(FixedDatum))]
- [XmlInclude(typeof(VariableDatum))]
- public partial class DataReliablePdu : SimulationManagementWithReliabilityFamilyPdu, IEquatable
- {
- ///
- /// Request ID
- ///
- private uint _requestID;
-
- ///
- /// level of reliability service used for this transaction
- ///
- private byte _requiredReliabilityService;
-
- ///
- /// padding
- ///
- private ushort _pad1;
-
- ///
- /// padding
- ///
- private byte _pad2;
-
- ///
- /// Fixed datum record count
- ///
- private uint _numberOfFixedDatumRecords;
-
- ///
- /// variable datum record count
- ///
- private uint _numberOfVariableDatumRecords;
-
- ///
- /// Fixed datum records
- ///
- private List _fixedDatumRecords = new List();
-
- ///
- /// Variable datum records
- ///
- private List _variableDatumRecords = new List();
-
- ///
- /// Initializes a new instance of the class.
- ///
- public DataReliablePdu()
- {
- PduType = (byte)60;
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(DataReliablePdu left, DataReliablePdu right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(DataReliablePdu left, DataReliablePdu right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public override int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize = base.GetMarshalledSize();
- marshalSize += 4; // this._requestID
- marshalSize += 1; // this._requiredReliabilityService
- marshalSize += 2; // this._pad1
- marshalSize += 1; // this._pad2
- marshalSize += 4; // this._numberOfFixedDatumRecords
- marshalSize += 4; // this._numberOfVariableDatumRecords
- for (int idx = 0; idx < this._fixedDatumRecords.Count; idx++)
- {
- FixedDatum listElement = (FixedDatum)this._fixedDatumRecords[idx];
- marshalSize += listElement.GetMarshalledSize();
- }
-
- for (int idx = 0; idx < this._variableDatumRecords.Count; idx++)
- {
- VariableDatum listElement = (VariableDatum)this._variableDatumRecords[idx];
- marshalSize += listElement.GetMarshalledSize();
- }
-
- return marshalSize;
- }
-
- ///
- /// Gets or sets the Request ID
- ///
- [XmlElement(Type = typeof(uint), ElementName = "requestID")]
- public uint RequestID
- {
- get
- {
- return this._requestID;
- }
-
- set
- {
- this._requestID = value;
- }
- }
-
- ///
- /// Gets or sets the level of reliability service used for this transaction
- ///
- [XmlElement(Type = typeof(byte), ElementName = "requiredReliabilityService")]
- public byte RequiredReliabilityService
- {
- get
- {
- return this._requiredReliabilityService;
- }
-
- set
- {
- this._requiredReliabilityService = value;
- }
- }
-
- ///
- /// Gets or sets the padding
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "pad1")]
- public ushort Pad1
- {
- get
- {
- return this._pad1;
- }
-
- set
- {
- this._pad1 = value;
- }
- }
-
- ///
- /// Gets or sets the padding
- ///
- [XmlElement(Type = typeof(byte), ElementName = "pad2")]
- public byte Pad2
- {
- get
- {
- return this._pad2;
- }
-
- set
- {
- this._pad2 = value;
- }
- }
-
- ///
- /// Note that setting this value will not change the marshalled value. The list whose length this describes is used for that purpose.
- /// The getnumberOfFixedDatumRecords method will also be based on the actual list length rather than this value.
- /// The method is simply here for completeness and should not be used for any computations.
- ///
- [XmlElement(Type = typeof(uint), ElementName = "numberOfFixedDatumRecords")]
- public uint NumberOfFixedDatumRecords
- {
- get
- {
- return this._numberOfFixedDatumRecords;
- }
-
- set
- {
- this._numberOfFixedDatumRecords = value;
- }
- }
-
- ///
- /// Note that setting this value will not change the marshalled value. The list whose length this describes is used for that purpose.
- /// The getnumberOfVariableDatumRecords method will also be based on the actual list length rather than this value.
- /// The method is simply here for completeness and should not be used for any computations.
- ///
- [XmlElement(Type = typeof(uint), ElementName = "numberOfVariableDatumRecords")]
- public uint NumberOfVariableDatumRecords
- {
- get
- {
- return this._numberOfVariableDatumRecords;
- }
-
- set
- {
- this._numberOfVariableDatumRecords = value;
- }
- }
-
- ///
- /// Gets or sets the Fixed datum records
- ///
- [XmlElement(ElementName = "fixedDatumRecordsList", Type = typeof(List))]
- public List FixedDatumRecords
- {
- get
- {
- return this._fixedDatumRecords;
- }
- }
-
- ///
- /// Gets or sets the Variable datum records
- ///
- [XmlElement(ElementName = "variableDatumRecordsList", Type = typeof(List))]
- public List VariableDatumRecords
- {
- get
- {
- return this._variableDatumRecords;
- }
- }
-
- ///
- /// Automatically sets the length of the marshalled data, then calls the marshal method.
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- public override void MarshalAutoLengthSet(DataOutputStream dos)
- {
- // Set the length prior to marshalling data
- this.Length = (ushort)this.GetMarshalledSize();
- this.Marshal(dos);
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Marshal(DataOutputStream dos)
- {
- base.Marshal(dos);
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedInt((uint)this._requestID);
- dos.WriteUnsignedByte((byte)this._requiredReliabilityService);
- dos.WriteUnsignedShort((ushort)this._pad1);
- dos.WriteUnsignedByte((byte)this._pad2);
- dos.WriteUnsignedInt((uint)this._fixedDatumRecords.Count);
- dos.WriteUnsignedInt((uint)this._variableDatumRecords.Count);
-
- for (int idx = 0; idx < this._fixedDatumRecords.Count; idx++)
- {
- FixedDatum aFixedDatum = (FixedDatum)this._fixedDatumRecords[idx];
- aFixedDatum.Marshal(dos);
- }
-
- for (int idx = 0; idx < this._variableDatumRecords.Count; idx++)
- {
- VariableDatum aVariableDatum = (VariableDatum)this._variableDatumRecords[idx];
- aVariableDatum.Marshal(dos);
- }
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Unmarshal(DataInputStream dis)
- {
- base.Unmarshal(dis);
-
- if (dis != null)
- {
- try
- {
- this._requestID = dis.ReadUnsignedInt();
- this._requiredReliabilityService = dis.ReadUnsignedByte();
- this._pad1 = dis.ReadUnsignedShort();
- this._pad2 = dis.ReadUnsignedByte();
- this._numberOfFixedDatumRecords = dis.ReadUnsignedInt();
- this._numberOfVariableDatumRecords = dis.ReadUnsignedInt();
- for (int idx = 0; idx < this.NumberOfFixedDatumRecords; idx++)
- {
- FixedDatum anX = new FixedDatum();
- anX.Unmarshal(dis);
- this._fixedDatumRecords.Add(anX);
- };
-
- for (int idx = 0; idx < this.NumberOfVariableDatumRecords; idx++)
- {
- VariableDatum anX = new VariableDatum();
- anX.Unmarshal(dis);
- this._variableDatumRecords.Add(anX);
- };
-
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- base.Reflection(sb);
- try
- {
- sb.AppendLine("" + this._requestID.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._requiredReliabilityService.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._pad1.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._pad2.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._fixedDatumRecords.Count.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._variableDatumRecords.Count.ToString(CultureInfo.InvariantCulture) + "");
- for (int idx = 0; idx < this._fixedDatumRecords.Count; idx++)
- {
- sb.AppendLine("");
- FixedDatum aFixedDatum = (FixedDatum)this._fixedDatumRecords[idx];
- aFixedDatum.Reflection(sb);
- sb.AppendLine("");
- }
-
- for (int idx = 0; idx < this._variableDatumRecords.Count; idx++)
- {
- sb.AppendLine("");
- VariableDatum aVariableDatum = (VariableDatum)this._variableDatumRecords[idx];
- aVariableDatum.Reflection(sb);
- sb.AppendLine("");
- }
-
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as DataReliablePdu;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(DataReliablePdu obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- ivarsEqual = base.Equals(obj);
-
- if (this._requestID != obj._requestID)
- {
- ivarsEqual = false;
- }
-
- if (this._requiredReliabilityService != obj._requiredReliabilityService)
- {
- ivarsEqual = false;
- }
-
- if (this._pad1 != obj._pad1)
- {
- ivarsEqual = false;
- }
-
- if (this._pad2 != obj._pad2)
- {
- ivarsEqual = false;
- }
-
- if (this._numberOfFixedDatumRecords != obj._numberOfFixedDatumRecords)
- {
- ivarsEqual = false;
- }
-
- if (this._numberOfVariableDatumRecords != obj._numberOfVariableDatumRecords)
- {
- ivarsEqual = false;
- }
-
- if (this._fixedDatumRecords.Count != obj._fixedDatumRecords.Count)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < this._fixedDatumRecords.Count; idx++)
- {
- if (!this._fixedDatumRecords[idx].Equals(obj._fixedDatumRecords[idx]))
- {
- ivarsEqual = false;
- }
- }
- }
-
- if (this._variableDatumRecords.Count != obj._variableDatumRecords.Count)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < this._variableDatumRecords.Count; idx++)
- {
- if (!this._variableDatumRecords[idx].Equals(obj._variableDatumRecords[idx]))
- {
- ivarsEqual = false;
- }
- }
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ base.GetHashCode();
-
- result = GenerateHash(result) ^ this._requestID.GetHashCode();
- result = GenerateHash(result) ^ this._requiredReliabilityService.GetHashCode();
- result = GenerateHash(result) ^ this._pad1.GetHashCode();
- result = GenerateHash(result) ^ this._pad2.GetHashCode();
- result = GenerateHash(result) ^ this._numberOfFixedDatumRecords.GetHashCode();
- result = GenerateHash(result) ^ this._numberOfVariableDatumRecords.GetHashCode();
-
- if (this._fixedDatumRecords.Count > 0)
- {
- for (int idx = 0; idx < this._fixedDatumRecords.Count; idx++)
- {
- result = GenerateHash(result) ^ this._fixedDatumRecords[idx].GetHashCode();
- }
- }
-
- if (this._variableDatumRecords.Count > 0)
- {
- for (int idx = 0; idx < this._variableDatumRecords.Count; idx++)
- {
- result = GenerateHash(result) ^ this._variableDatumRecords[idx].GetHashCode();
- }
- }
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/DatumSpecification.cs b/tests/OpenDisNet.Reference/Generated/DatumSpecification.cs
deleted file mode 100644
index 815c1e4..0000000
--- a/tests/OpenDisNet.Reference/Generated/DatumSpecification.cs
+++ /dev/null
@@ -1,451 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// List of fixed and variable datum records. Section 6.2.19
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(FixedDatum))]
- [XmlInclude(typeof(VariableDatum))]
- public partial class DatumSpecification
- {
- ///
- /// Number of fixed datums
- ///
- private uint _numberOfFixedDatums;
-
- ///
- /// Number of variable datums
- ///
- private uint _numberOfVariableDatums;
-
- ///
- /// variable length list fixed datums
- ///
- private List _fixedDatumIDList = new List();
-
- ///
- /// variable length list variable datums
- ///
- private List _variableDatumIDList = new List();
-
- ///
- /// Initializes a new instance of the class.
- ///
- public DatumSpecification()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(DatumSpecification left, DatumSpecification right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(DatumSpecification left, DatumSpecification right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += 4; // this._numberOfFixedDatums
- marshalSize += 4; // this._numberOfVariableDatums
- for (int idx = 0; idx < this._fixedDatumIDList.Count; idx++)
- {
- FixedDatum listElement = (FixedDatum)this._fixedDatumIDList[idx];
- marshalSize += listElement.GetMarshalledSize();
- }
-
- for (int idx = 0; idx < this._variableDatumIDList.Count; idx++)
- {
- VariableDatum listElement = (VariableDatum)this._variableDatumIDList[idx];
- marshalSize += listElement.GetMarshalledSize();
- }
-
- return marshalSize;
- }
-
- ///
- /// Note that setting this value will not change the marshalled value. The list whose length this describes is used for that purpose.
- /// The getnumberOfFixedDatums method will also be based on the actual list length rather than this value.
- /// The method is simply here for completeness and should not be used for any computations.
- ///
- [XmlElement(Type = typeof(uint), ElementName = "numberOfFixedDatums")]
- public uint NumberOfFixedDatums
- {
- get
- {
- return this._numberOfFixedDatums;
- }
-
- set
- {
- this._numberOfFixedDatums = value;
- }
- }
-
- ///
- /// Note that setting this value will not change the marshalled value. The list whose length this describes is used for that purpose.
- /// The getnumberOfVariableDatums method will also be based on the actual list length rather than this value.
- /// The method is simply here for completeness and should not be used for any computations.
- ///
- [XmlElement(Type = typeof(uint), ElementName = "numberOfVariableDatums")]
- public uint NumberOfVariableDatums
- {
- get
- {
- return this._numberOfVariableDatums;
- }
-
- set
- {
- this._numberOfVariableDatums = value;
- }
- }
-
- ///
- /// Gets or sets the variable length list fixed datums
- ///
- [XmlElement(ElementName = "fixedDatumIDListList", Type = typeof(List))]
- public List FixedDatumIDList
- {
- get
- {
- return this._fixedDatumIDList;
- }
- }
-
- ///
- /// Gets or sets the variable length list variable datums
- ///
- [XmlElement(ElementName = "variableDatumIDListList", Type = typeof(List))]
- public List VariableDatumIDList
- {
- get
- {
- return this._variableDatumIDList;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedInt((uint)this._fixedDatumIDList.Count);
- dos.WriteUnsignedInt((uint)this._variableDatumIDList.Count);
-
- for (int idx = 0; idx < this._fixedDatumIDList.Count; idx++)
- {
- FixedDatum aFixedDatum = (FixedDatum)this._fixedDatumIDList[idx];
- aFixedDatum.Marshal(dos);
- }
-
- for (int idx = 0; idx < this._variableDatumIDList.Count; idx++)
- {
- VariableDatum aVariableDatum = (VariableDatum)this._variableDatumIDList[idx];
- aVariableDatum.Marshal(dos);
- }
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._numberOfFixedDatums = dis.ReadUnsignedInt();
- this._numberOfVariableDatums = dis.ReadUnsignedInt();
- for (int idx = 0; idx < this.NumberOfFixedDatums; idx++)
- {
- FixedDatum anX = new FixedDatum();
- anX.Unmarshal(dis);
- this._fixedDatumIDList.Add(anX);
- };
-
- for (int idx = 0; idx < this.NumberOfVariableDatums; idx++)
- {
- VariableDatum anX = new VariableDatum();
- anX.Unmarshal(dis);
- this._variableDatumIDList.Add(anX);
- };
-
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("" + this._fixedDatumIDList.Count.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._variableDatumIDList.Count.ToString(CultureInfo.InvariantCulture) + "");
- for (int idx = 0; idx < this._fixedDatumIDList.Count; idx++)
- {
- sb.AppendLine("");
- FixedDatum aFixedDatum = (FixedDatum)this._fixedDatumIDList[idx];
- aFixedDatum.Reflection(sb);
- sb.AppendLine("");
- }
-
- for (int idx = 0; idx < this._variableDatumIDList.Count; idx++)
- {
- sb.AppendLine("");
- VariableDatum aVariableDatum = (VariableDatum)this._variableDatumIDList[idx];
- aVariableDatum.Reflection(sb);
- sb.AppendLine("");
- }
-
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as DatumSpecification;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(DatumSpecification obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (this._numberOfFixedDatums != obj._numberOfFixedDatums)
- {
- ivarsEqual = false;
- }
-
- if (this._numberOfVariableDatums != obj._numberOfVariableDatums)
- {
- ivarsEqual = false;
- }
-
- if (this._fixedDatumIDList.Count != obj._fixedDatumIDList.Count)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < this._fixedDatumIDList.Count; idx++)
- {
- if (!this._fixedDatumIDList[idx].Equals(obj._fixedDatumIDList[idx]))
- {
- ivarsEqual = false;
- }
- }
- }
-
- if (this._variableDatumIDList.Count != obj._variableDatumIDList.Count)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < this._variableDatumIDList.Count; idx++)
- {
- if (!this._variableDatumIDList[idx].Equals(obj._variableDatumIDList[idx]))
- {
- ivarsEqual = false;
- }
- }
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._numberOfFixedDatums.GetHashCode();
- result = GenerateHash(result) ^ this._numberOfVariableDatums.GetHashCode();
-
- if (this._fixedDatumIDList.Count > 0)
- {
- for (int idx = 0; idx < this._fixedDatumIDList.Count; idx++)
- {
- result = GenerateHash(result) ^ this._fixedDatumIDList[idx].GetHashCode();
- }
- }
-
- if (this._variableDatumIDList.Count > 0)
- {
- for (int idx = 0; idx < this._variableDatumIDList.Count; idx++)
- {
- result = GenerateHash(result) ^ this._variableDatumIDList[idx].GetHashCode();
- }
- }
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/DeadReckoningParameters.cs b/tests/OpenDisNet.Reference/Generated/DeadReckoningParameters.cs
deleted file mode 100644
index 2e66b03..0000000
--- a/tests/OpenDisNet.Reference/Generated/DeadReckoningParameters.cs
+++ /dev/null
@@ -1,404 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Not specified in the standard. This is used by the ESPDU
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(Vector3Float))]
- public partial class DeadReckoningParameters
- {
- ///
- /// Algorithm to use in computing dead reckoning. See EBV doc.
- ///
- private byte _deadReckoningAlgorithm;
-
- ///
- /// Dead reckoning parameters. Contents depends on algorithm.
- ///
- private byte[] _parameters = new byte[15];
-
- ///
- /// Linear acceleration of the entity
- ///
- private Vector3Float _entityLinearAcceleration = new Vector3Float();
-
- ///
- /// Angular velocity of the entity
- ///
- private Vector3Float _entityAngularVelocity = new Vector3Float();
-
- ///
- /// Initializes a new instance of the class.
- ///
- public DeadReckoningParameters()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(DeadReckoningParameters left, DeadReckoningParameters right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(DeadReckoningParameters left, DeadReckoningParameters right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += 1; // this._deadReckoningAlgorithm
- marshalSize += 15 * 1; // _parameters
- marshalSize += this._entityLinearAcceleration.GetMarshalledSize(); // this._entityLinearAcceleration
- marshalSize += this._entityAngularVelocity.GetMarshalledSize(); // this._entityAngularVelocity
- return marshalSize;
- }
-
- ///
- /// Gets or sets the Algorithm to use in computing dead reckoning. See EBV doc.
- ///
- [XmlElement(Type = typeof(byte), ElementName = "deadReckoningAlgorithm")]
- public byte DeadReckoningAlgorithm
- {
- get
- {
- return this._deadReckoningAlgorithm;
- }
-
- set
- {
- this._deadReckoningAlgorithm = value;
- }
- }
-
- ///
- /// Gets or sets the Dead reckoning parameters. Contents depends on algorithm.
- ///
- [XmlArray(ElementName = "parameters")]
- public byte[] Parameters
- {
- get
- {
- return this._parameters;
- }
-
- set
- {
- this._parameters = value;
- }
-}
-
- ///
- /// Gets or sets the Linear acceleration of the entity
- ///
- [XmlElement(Type = typeof(Vector3Float), ElementName = "entityLinearAcceleration")]
- public Vector3Float EntityLinearAcceleration
- {
- get
- {
- return this._entityLinearAcceleration;
- }
-
- set
- {
- this._entityLinearAcceleration = value;
- }
- }
-
- ///
- /// Gets or sets the Angular velocity of the entity
- ///
- [XmlElement(Type = typeof(Vector3Float), ElementName = "entityAngularVelocity")]
- public Vector3Float EntityAngularVelocity
- {
- get
- {
- return this._entityAngularVelocity;
- }
-
- set
- {
- this._entityAngularVelocity = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedByte((byte)this._deadReckoningAlgorithm);
-
- for (int idx = 0; idx < this._parameters.Length; idx++)
- {
- dos.WriteUnsignedByte(this._parameters[idx]);
- }
- this._entityLinearAcceleration.Marshal(dos);
- this._entityAngularVelocity.Marshal(dos);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._deadReckoningAlgorithm = dis.ReadUnsignedByte();
- for (int idx = 0; idx < this._parameters.Length; idx++)
- {
- this._parameters[idx] = dis.ReadUnsignedByte();
- }
- this._entityLinearAcceleration.Unmarshal(dis);
- this._entityAngularVelocity.Unmarshal(dis);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("" + this._deadReckoningAlgorithm.ToString(CultureInfo.InvariantCulture) + "");
- for (int idx = 0; idx < this._parameters.Length; idx++)
- {
- sb.AppendLine("" + this._parameters[idx] + "");
- }
-
- sb.AppendLine("");
- this._entityLinearAcceleration.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- this._entityAngularVelocity.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as DeadReckoningParameters;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(DeadReckoningParameters obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (this._deadReckoningAlgorithm != obj._deadReckoningAlgorithm)
- {
- ivarsEqual = false;
- }
-
- if (obj._parameters.Length != 15)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < 15; idx++)
- {
- if (this._parameters[idx] != obj._parameters[idx])
- {
- ivarsEqual = false;
- }
- }
- }
-
- if (!this._entityLinearAcceleration.Equals(obj._entityLinearAcceleration))
- {
- ivarsEqual = false;
- }
-
- if (!this._entityAngularVelocity.Equals(obj._entityAngularVelocity))
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._deadReckoningAlgorithm.GetHashCode();
-
- for (int idx = 0; idx < 15; idx++)
- {
- result = GenerateHash(result) ^ this._parameters[idx].GetHashCode();
- }
- result = GenerateHash(result) ^ this._entityLinearAcceleration.GetHashCode();
- result = GenerateHash(result) ^ this._entityAngularVelocity.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/DesignatorPdu.cs b/tests/OpenDisNet.Reference/Generated/DesignatorPdu.cs
deleted file mode 100644
index d7ecdd2..0000000
--- a/tests/OpenDisNet.Reference/Generated/DesignatorPdu.cs
+++ /dev/null
@@ -1,646 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Section 5.3.7.2. Handles designating operations. COMPLETE
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(EntityID))]
- [XmlInclude(typeof(Vector3Float))]
- [XmlInclude(typeof(Vector3Double))]
- public partial class DesignatorPdu : DistributedEmissionsFamilyPdu, IEquatable
- {
- ///
- /// ID of the entity designating
- ///
- private EntityID _designatingEntityID = new EntityID();
-
- ///
- /// This field shall specify a unique emitter database number assigned to differentiate between otherwise similar or identical emitter beams within an emitter system.
- ///
- private ushort _codeName;
-
- ///
- /// ID of the entity being designated
- ///
- private EntityID _designatedEntityID = new EntityID();
-
- ///
- /// This field shall identify the designator code being used by the designating entity
- ///
- private ushort _designatorCode;
-
- ///
- /// This field shall identify the designator output power in watts
- ///
- private float _designatorPower;
-
- ///
- /// This field shall identify the designator wavelength in units of microns
- ///
- private float _designatorWavelength;
-
- ///
- /// designtor spot wrt the designated entity
- ///
- private Vector3Float _designatorSpotWrtDesignated = new Vector3Float();
-
- ///
- /// designtor spot wrt the designated entity
- ///
- private Vector3Double _designatorSpotLocation = new Vector3Double();
-
- ///
- /// Dead reckoning algorithm
- ///
- private byte _deadReckoningAlgorithm;
-
- ///
- /// padding
- ///
- private ushort _padding1;
-
- ///
- /// padding
- ///
- private byte _padding2;
-
- ///
- /// linear accelleration of entity
- ///
- private Vector3Float _entityLinearAcceleration = new Vector3Float();
-
- ///
- /// Initializes a new instance of the class.
- ///
- public DesignatorPdu()
- {
- PduType = (byte)24;
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(DesignatorPdu left, DesignatorPdu right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(DesignatorPdu left, DesignatorPdu right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public override int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize = base.GetMarshalledSize();
- marshalSize += this._designatingEntityID.GetMarshalledSize(); // this._designatingEntityID
- marshalSize += 2; // this._codeName
- marshalSize += this._designatedEntityID.GetMarshalledSize(); // this._designatedEntityID
- marshalSize += 2; // this._designatorCode
- marshalSize += 4; // this._designatorPower
- marshalSize += 4; // this._designatorWavelength
- marshalSize += this._designatorSpotWrtDesignated.GetMarshalledSize(); // this._designatorSpotWrtDesignated
- marshalSize += this._designatorSpotLocation.GetMarshalledSize(); // this._designatorSpotLocation
- marshalSize += 1; // this._deadReckoningAlgorithm
- marshalSize += 2; // this._padding1
- marshalSize += 1; // this._padding2
- marshalSize += this._entityLinearAcceleration.GetMarshalledSize(); // this._entityLinearAcceleration
- return marshalSize;
- }
-
- ///
- /// Gets or sets the ID of the entity designating
- ///
- [XmlElement(Type = typeof(EntityID), ElementName = "designatingEntityID")]
- public EntityID DesignatingEntityID
- {
- get
- {
- return this._designatingEntityID;
- }
-
- set
- {
- this._designatingEntityID = value;
- }
- }
-
- ///
- /// Gets or sets the This field shall specify a unique emitter database number assigned to differentiate between otherwise similar or identical emitter beams within an emitter system.
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "codeName")]
- public ushort CodeName
- {
- get
- {
- return this._codeName;
- }
-
- set
- {
- this._codeName = value;
- }
- }
-
- ///
- /// Gets or sets the ID of the entity being designated
- ///
- [XmlElement(Type = typeof(EntityID), ElementName = "designatedEntityID")]
- public EntityID DesignatedEntityID
- {
- get
- {
- return this._designatedEntityID;
- }
-
- set
- {
- this._designatedEntityID = value;
- }
- }
-
- ///
- /// Gets or sets the This field shall identify the designator code being used by the designating entity
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "designatorCode")]
- public ushort DesignatorCode
- {
- get
- {
- return this._designatorCode;
- }
-
- set
- {
- this._designatorCode = value;
- }
- }
-
- ///
- /// Gets or sets the This field shall identify the designator output power in watts
- ///
- [XmlElement(Type = typeof(float), ElementName = "designatorPower")]
- public float DesignatorPower
- {
- get
- {
- return this._designatorPower;
- }
-
- set
- {
- this._designatorPower = value;
- }
- }
-
- ///
- /// Gets or sets the This field shall identify the designator wavelength in units of microns
- ///
- [XmlElement(Type = typeof(float), ElementName = "designatorWavelength")]
- public float DesignatorWavelength
- {
- get
- {
- return this._designatorWavelength;
- }
-
- set
- {
- this._designatorWavelength = value;
- }
- }
-
- ///
- /// Gets or sets the designtor spot wrt the designated entity
- ///
- [XmlElement(Type = typeof(Vector3Float), ElementName = "designatorSpotWrtDesignated")]
- public Vector3Float DesignatorSpotWrtDesignated
- {
- get
- {
- return this._designatorSpotWrtDesignated;
- }
-
- set
- {
- this._designatorSpotWrtDesignated = value;
- }
- }
-
- ///
- /// Gets or sets the designtor spot wrt the designated entity
- ///
- [XmlElement(Type = typeof(Vector3Double), ElementName = "designatorSpotLocation")]
- public Vector3Double DesignatorSpotLocation
- {
- get
- {
- return this._designatorSpotLocation;
- }
-
- set
- {
- this._designatorSpotLocation = value;
- }
- }
-
- ///
- /// Gets or sets the Dead reckoning algorithm
- ///
- [XmlElement(Type = typeof(byte), ElementName = "deadReckoningAlgorithm")]
- public byte DeadReckoningAlgorithm
- {
- get
- {
- return this._deadReckoningAlgorithm;
- }
-
- set
- {
- this._deadReckoningAlgorithm = value;
- }
- }
-
- ///
- /// Gets or sets the padding
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "padding1")]
- public ushort Padding1
- {
- get
- {
- return this._padding1;
- }
-
- set
- {
- this._padding1 = value;
- }
- }
-
- ///
- /// Gets or sets the padding
- ///
- [XmlElement(Type = typeof(byte), ElementName = "padding2")]
- public byte Padding2
- {
- get
- {
- return this._padding2;
- }
-
- set
- {
- this._padding2 = value;
- }
- }
-
- ///
- /// Gets or sets the linear accelleration of entity
- ///
- [XmlElement(Type = typeof(Vector3Float), ElementName = "entityLinearAcceleration")]
- public Vector3Float EntityLinearAcceleration
- {
- get
- {
- return this._entityLinearAcceleration;
- }
-
- set
- {
- this._entityLinearAcceleration = value;
- }
- }
-
- ///
- /// Automatically sets the length of the marshalled data, then calls the marshal method.
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- public override void MarshalAutoLengthSet(DataOutputStream dos)
- {
- // Set the length prior to marshalling data
- this.Length = (ushort)this.GetMarshalledSize();
- this.Marshal(dos);
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Marshal(DataOutputStream dos)
- {
- base.Marshal(dos);
- if (dos != null)
- {
- try
- {
- this._designatingEntityID.Marshal(dos);
- dos.WriteUnsignedShort((ushort)this._codeName);
- this._designatedEntityID.Marshal(dos);
- dos.WriteUnsignedShort((ushort)this._designatorCode);
- dos.WriteFloat((float)this._designatorPower);
- dos.WriteFloat((float)this._designatorWavelength);
- this._designatorSpotWrtDesignated.Marshal(dos);
- this._designatorSpotLocation.Marshal(dos);
- dos.WriteByte((byte)this._deadReckoningAlgorithm);
- dos.WriteUnsignedShort((ushort)this._padding1);
- dos.WriteByte((byte)this._padding2);
- this._entityLinearAcceleration.Marshal(dos);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Unmarshal(DataInputStream dis)
- {
- base.Unmarshal(dis);
-
- if (dis != null)
- {
- try
- {
- this._designatingEntityID.Unmarshal(dis);
- this._codeName = dis.ReadUnsignedShort();
- this._designatedEntityID.Unmarshal(dis);
- this._designatorCode = dis.ReadUnsignedShort();
- this._designatorPower = dis.ReadFloat();
- this._designatorWavelength = dis.ReadFloat();
- this._designatorSpotWrtDesignated.Unmarshal(dis);
- this._designatorSpotLocation.Unmarshal(dis);
- this._deadReckoningAlgorithm = dis.ReadByte();
- this._padding1 = dis.ReadUnsignedShort();
- this._padding2 = dis.ReadByte();
- this._entityLinearAcceleration.Unmarshal(dis);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- base.Reflection(sb);
- try
- {
- sb.AppendLine("");
- this._designatingEntityID.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._codeName.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- this._designatedEntityID.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._designatorCode.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._designatorPower.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._designatorWavelength.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- this._designatorSpotWrtDesignated.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- this._designatorSpotLocation.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._deadReckoningAlgorithm.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._padding1.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._padding2.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- this._entityLinearAcceleration.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as DesignatorPdu;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(DesignatorPdu obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- ivarsEqual = base.Equals(obj);
-
- if (!this._designatingEntityID.Equals(obj._designatingEntityID))
- {
- ivarsEqual = false;
- }
-
- if (this._codeName != obj._codeName)
- {
- ivarsEqual = false;
- }
-
- if (!this._designatedEntityID.Equals(obj._designatedEntityID))
- {
- ivarsEqual = false;
- }
-
- if (this._designatorCode != obj._designatorCode)
- {
- ivarsEqual = false;
- }
-
- if (this._designatorPower != obj._designatorPower)
- {
- ivarsEqual = false;
- }
-
- if (this._designatorWavelength != obj._designatorWavelength)
- {
- ivarsEqual = false;
- }
-
- if (!this._designatorSpotWrtDesignated.Equals(obj._designatorSpotWrtDesignated))
- {
- ivarsEqual = false;
- }
-
- if (!this._designatorSpotLocation.Equals(obj._designatorSpotLocation))
- {
- ivarsEqual = false;
- }
-
- if (this._deadReckoningAlgorithm != obj._deadReckoningAlgorithm)
- {
- ivarsEqual = false;
- }
-
- if (this._padding1 != obj._padding1)
- {
- ivarsEqual = false;
- }
-
- if (this._padding2 != obj._padding2)
- {
- ivarsEqual = false;
- }
-
- if (!this._entityLinearAcceleration.Equals(obj._entityLinearAcceleration))
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ base.GetHashCode();
-
- result = GenerateHash(result) ^ this._designatingEntityID.GetHashCode();
- result = GenerateHash(result) ^ this._codeName.GetHashCode();
- result = GenerateHash(result) ^ this._designatedEntityID.GetHashCode();
- result = GenerateHash(result) ^ this._designatorCode.GetHashCode();
- result = GenerateHash(result) ^ this._designatorPower.GetHashCode();
- result = GenerateHash(result) ^ this._designatorWavelength.GetHashCode();
- result = GenerateHash(result) ^ this._designatorSpotWrtDesignated.GetHashCode();
- result = GenerateHash(result) ^ this._designatorSpotLocation.GetHashCode();
- result = GenerateHash(result) ^ this._deadReckoningAlgorithm.GetHashCode();
- result = GenerateHash(result) ^ this._padding1.GetHashCode();
- result = GenerateHash(result) ^ this._padding2.GetHashCode();
- result = GenerateHash(result) ^ this._entityLinearAcceleration.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/DetonationPdu.cs b/tests/OpenDisNet.Reference/Generated/DetonationPdu.cs
deleted file mode 100644
index 7fa0ebe..0000000
--- a/tests/OpenDisNet.Reference/Generated/DetonationPdu.cs
+++ /dev/null
@@ -1,625 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Detonation or impact of munitions, as well as, non-munition explosions, the burst or initial bloom of chaff, and the ignition of a flare shall be indicated. Section 7.3.3 COMPLETE
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(EntityID))]
- [XmlInclude(typeof(EventIdentifier))]
- [XmlInclude(typeof(Vector3Float))]
- [XmlInclude(typeof(Vector3Double))]
- [XmlInclude(typeof(MunitionDescriptor))]
- [XmlInclude(typeof(VariableParameter))]
- public partial class DetonationPdu : WarfareFamilyPdu, IEquatable
- {
- ///
- /// ID of the expendable entity, Section 7.3.3
- ///
- private EntityID _explodingEntityID = new EntityID();
-
- ///
- /// ID of event, Section 7.3.3
- ///
- private EventIdentifier _eventID = new EventIdentifier();
-
- ///
- /// velocity of the munition immediately before detonation/impact, Section 7.3.3
- ///
- private Vector3Float _velocity = new Vector3Float();
-
- ///
- /// location of the munition detonation, the expendable detonation, Section 7.3.3
- ///
- private Vector3Double _locationInWorldCoordinates = new Vector3Double();
-
- ///
- /// Describes the detonation represented, Section 7.3.3
- ///
- private MunitionDescriptor _descriptor = new MunitionDescriptor();
-
- ///
- /// Velocity of the ammunition, Section 7.3.3
- ///
- private Vector3Float _locationOfEntityCoordinates = new Vector3Float();
-
- ///
- /// result of the detonation, Section 7.3.3
- ///
- private byte _detonationResult;
-
- ///
- /// How many articulation parameters we have, Section 7.3.3
- ///
- private byte _numberOfVariableParameters;
-
- ///
- /// padding
- ///
- private ushort _pad;
-
- ///
- /// specify the parameter values for each Variable Parameter record, Section 7.3.3
- ///
- private List _variableParameters = new List();
-
- ///
- /// Initializes a new instance of the class.
- ///
- public DetonationPdu()
- {
- PduType = (byte)3;
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(DetonationPdu left, DetonationPdu right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(DetonationPdu left, DetonationPdu right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public override int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize = base.GetMarshalledSize();
- marshalSize += this._explodingEntityID.GetMarshalledSize(); // this._explodingEntityID
- marshalSize += this._eventID.GetMarshalledSize(); // this._eventID
- marshalSize += this._velocity.GetMarshalledSize(); // this._velocity
- marshalSize += this._locationInWorldCoordinates.GetMarshalledSize(); // this._locationInWorldCoordinates
- marshalSize += this._descriptor.GetMarshalledSize(); // this._descriptor
- marshalSize += this._locationOfEntityCoordinates.GetMarshalledSize(); // this._locationOfEntityCoordinates
- marshalSize += 1; // this._detonationResult
- marshalSize += 1; // this._numberOfVariableParameters
- marshalSize += 2; // this._pad
- for (int idx = 0; idx < this._variableParameters.Count; idx++)
- {
- VariableParameter listElement = (VariableParameter)this._variableParameters[idx];
- marshalSize += listElement.GetMarshalledSize();
- }
-
- return marshalSize;
- }
-
- ///
- /// Gets or sets the ID of the expendable entity, Section 7.3.3
- ///
- [XmlElement(Type = typeof(EntityID), ElementName = "explodingEntityID")]
- public EntityID ExplodingEntityID
- {
- get
- {
- return this._explodingEntityID;
- }
-
- set
- {
- this._explodingEntityID = value;
- }
- }
-
- ///
- /// Gets or sets the ID of event, Section 7.3.3
- ///
- [XmlElement(Type = typeof(EventIdentifier), ElementName = "eventID")]
- public EventIdentifier EventID
- {
- get
- {
- return this._eventID;
- }
-
- set
- {
- this._eventID = value;
- }
- }
-
- ///
- /// Gets or sets the velocity of the munition immediately before detonation/impact, Section 7.3.3
- ///
- [XmlElement(Type = typeof(Vector3Float), ElementName = "velocity")]
- public Vector3Float Velocity
- {
- get
- {
- return this._velocity;
- }
-
- set
- {
- this._velocity = value;
- }
- }
-
- ///
- /// Gets or sets the location of the munition detonation, the expendable detonation, Section 7.3.3
- ///
- [XmlElement(Type = typeof(Vector3Double), ElementName = "locationInWorldCoordinates")]
- public Vector3Double LocationInWorldCoordinates
- {
- get
- {
- return this._locationInWorldCoordinates;
- }
-
- set
- {
- this._locationInWorldCoordinates = value;
- }
- }
-
- ///
- /// Gets or sets the Describes the detonation represented, Section 7.3.3
- ///
- [XmlElement(Type = typeof(MunitionDescriptor), ElementName = "descriptor")]
- public MunitionDescriptor Descriptor
- {
- get
- {
- return this._descriptor;
- }
-
- set
- {
- this._descriptor = value;
- }
- }
-
- ///
- /// Gets or sets the Velocity of the ammunition, Section 7.3.3
- ///
- [XmlElement(Type = typeof(Vector3Float), ElementName = "locationOfEntityCoordinates")]
- public Vector3Float LocationOfEntityCoordinates
- {
- get
- {
- return this._locationOfEntityCoordinates;
- }
-
- set
- {
- this._locationOfEntityCoordinates = value;
- }
- }
-
- ///
- /// Gets or sets the result of the detonation, Section 7.3.3
- ///
- [XmlElement(Type = typeof(byte), ElementName = "detonationResult")]
- public byte DetonationResult
- {
- get
- {
- return this._detonationResult;
- }
-
- set
- {
- this._detonationResult = value;
- }
- }
-
- ///
- /// Note that setting this value will not change the marshalled value. The list whose length this describes is used for that purpose.
- /// The getnumberOfVariableParameters method will also be based on the actual list length rather than this value.
- /// The method is simply here for completeness and should not be used for any computations.
- ///
- [XmlElement(Type = typeof(byte), ElementName = "numberOfVariableParameters")]
- public byte NumberOfVariableParameters
- {
- get
- {
- return this._numberOfVariableParameters;
- }
-
- set
- {
- this._numberOfVariableParameters = value;
- }
- }
-
- ///
- /// Gets or sets the padding
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "pad")]
- public ushort Pad
- {
- get
- {
- return this._pad;
- }
-
- set
- {
- this._pad = value;
- }
- }
-
- ///
- /// Gets or sets the specify the parameter values for each Variable Parameter record, Section 7.3.3
- ///
- [XmlElement(ElementName = "variableParametersList", Type = typeof(List))]
- public List VariableParameters
- {
- get
- {
- return this._variableParameters;
- }
- }
-
- ///
- /// Automatically sets the length of the marshalled data, then calls the marshal method.
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- public override void MarshalAutoLengthSet(DataOutputStream dos)
- {
- // Set the length prior to marshalling data
- this.Length = (ushort)this.GetMarshalledSize();
- this.Marshal(dos);
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Marshal(DataOutputStream dos)
- {
- base.Marshal(dos);
- if (dos != null)
- {
- try
- {
- this._explodingEntityID.Marshal(dos);
- this._eventID.Marshal(dos);
- this._velocity.Marshal(dos);
- this._locationInWorldCoordinates.Marshal(dos);
- this._descriptor.Marshal(dos);
- this._locationOfEntityCoordinates.Marshal(dos);
- dos.WriteUnsignedByte((byte)this._detonationResult);
- dos.WriteUnsignedByte((byte)this._variableParameters.Count);
- dos.WriteUnsignedShort((ushort)this._pad);
-
- for (int idx = 0; idx < this._variableParameters.Count; idx++)
- {
- VariableParameter aVariableParameter = (VariableParameter)this._variableParameters[idx];
- aVariableParameter.Marshal(dos);
- }
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Unmarshal(DataInputStream dis)
- {
- base.Unmarshal(dis);
-
- if (dis != null)
- {
- try
- {
- this._explodingEntityID.Unmarshal(dis);
- this._eventID.Unmarshal(dis);
- this._velocity.Unmarshal(dis);
- this._locationInWorldCoordinates.Unmarshal(dis);
- this._descriptor.Unmarshal(dis);
- this._locationOfEntityCoordinates.Unmarshal(dis);
- this._detonationResult = dis.ReadUnsignedByte();
- this._numberOfVariableParameters = dis.ReadUnsignedByte();
- this._pad = dis.ReadUnsignedShort();
- for (int idx = 0; idx < this.NumberOfVariableParameters; idx++)
- {
- VariableParameter anX = new VariableParameter();
- anX.Unmarshal(dis);
- this._variableParameters.Add(anX);
- };
-
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- base.Reflection(sb);
- try
- {
- sb.AppendLine("");
- this._explodingEntityID.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- this._eventID.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- this._velocity.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- this._locationInWorldCoordinates.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- this._descriptor.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- this._locationOfEntityCoordinates.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._detonationResult.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._variableParameters.Count.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._pad.ToString(CultureInfo.InvariantCulture) + "");
- for (int idx = 0; idx < this._variableParameters.Count; idx++)
- {
- sb.AppendLine("");
- VariableParameter aVariableParameter = (VariableParameter)this._variableParameters[idx];
- aVariableParameter.Reflection(sb);
- sb.AppendLine("");
- }
-
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as DetonationPdu;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(DetonationPdu obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- ivarsEqual = base.Equals(obj);
-
- if (!this._explodingEntityID.Equals(obj._explodingEntityID))
- {
- ivarsEqual = false;
- }
-
- if (!this._eventID.Equals(obj._eventID))
- {
- ivarsEqual = false;
- }
-
- if (!this._velocity.Equals(obj._velocity))
- {
- ivarsEqual = false;
- }
-
- if (!this._locationInWorldCoordinates.Equals(obj._locationInWorldCoordinates))
- {
- ivarsEqual = false;
- }
-
- if (!this._descriptor.Equals(obj._descriptor))
- {
- ivarsEqual = false;
- }
-
- if (!this._locationOfEntityCoordinates.Equals(obj._locationOfEntityCoordinates))
- {
- ivarsEqual = false;
- }
-
- if (this._detonationResult != obj._detonationResult)
- {
- ivarsEqual = false;
- }
-
- if (this._numberOfVariableParameters != obj._numberOfVariableParameters)
- {
- ivarsEqual = false;
- }
-
- if (this._pad != obj._pad)
- {
- ivarsEqual = false;
- }
-
- if (this._variableParameters.Count != obj._variableParameters.Count)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < this._variableParameters.Count; idx++)
- {
- if (!this._variableParameters[idx].Equals(obj._variableParameters[idx]))
- {
- ivarsEqual = false;
- }
- }
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ base.GetHashCode();
-
- result = GenerateHash(result) ^ this._explodingEntityID.GetHashCode();
- result = GenerateHash(result) ^ this._eventID.GetHashCode();
- result = GenerateHash(result) ^ this._velocity.GetHashCode();
- result = GenerateHash(result) ^ this._locationInWorldCoordinates.GetHashCode();
- result = GenerateHash(result) ^ this._descriptor.GetHashCode();
- result = GenerateHash(result) ^ this._locationOfEntityCoordinates.GetHashCode();
- result = GenerateHash(result) ^ this._detonationResult.GetHashCode();
- result = GenerateHash(result) ^ this._numberOfVariableParameters.GetHashCode();
- result = GenerateHash(result) ^ this._pad.GetHashCode();
-
- if (this._variableParameters.Count > 0)
- {
- for (int idx = 0; idx < this._variableParameters.Count; idx++)
- {
- result = GenerateHash(result) ^ this._variableParameters[idx].GetHashCode();
- }
- }
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/DirectedEnergyAreaAimpoint.cs b/tests/OpenDisNet.Reference/Generated/DirectedEnergyAreaAimpoint.cs
deleted file mode 100644
index aed713a..0000000
--- a/tests/OpenDisNet.Reference/Generated/DirectedEnergyAreaAimpoint.cs
+++ /dev/null
@@ -1,547 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// DE Precision Aimpoint Record. NOT COMPLETE. Section 6.2.21.2
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(BeamAntennaPattern))]
- [XmlInclude(typeof(DirectedEnergyTargetEnergyDeposition))]
- public partial class DirectedEnergyAreaAimpoint
- {
- ///
- /// Type of Record
- ///
- private uint _recordType = 4001;
-
- ///
- /// Length of Record
- ///
- private ushort _recordLength;
-
- ///
- /// Padding
- ///
- private ushort _padding;
-
- ///
- /// Number of beam antenna pattern records
- ///
- private ushort _beamAntennaPatternRecordCount;
-
- ///
- /// Number of DE target energy depositon records
- ///
- private ushort _directedEnergyTargetEnergyDepositionRecordCount;
-
- ///
- /// list of beam antenna records. See 6.2.9.2
- ///
- private List _beamAntennaParameterList = new List();
-
- ///
- /// list of DE target deposition records. See 6.2.21.4
- ///
- private List _directedEnergyTargetEnergyDepositionRecordList = new List();
-
- ///
- /// Initializes a new instance of the class.
- ///
- public DirectedEnergyAreaAimpoint()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(DirectedEnergyAreaAimpoint left, DirectedEnergyAreaAimpoint right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(DirectedEnergyAreaAimpoint left, DirectedEnergyAreaAimpoint right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += 4; // this._recordType
- marshalSize += 2; // this._recordLength
- marshalSize += 2; // this._padding
- marshalSize += 2; // this._beamAntennaPatternRecordCount
- marshalSize += 2; // this._directedEnergyTargetEnergyDepositionRecordCount
- for (int idx = 0; idx < this._beamAntennaParameterList.Count; idx++)
- {
- BeamAntennaPattern listElement = (BeamAntennaPattern)this._beamAntennaParameterList[idx];
- marshalSize += listElement.GetMarshalledSize();
- }
-
- for (int idx = 0; idx < this._directedEnergyTargetEnergyDepositionRecordList.Count; idx++)
- {
- DirectedEnergyTargetEnergyDeposition listElement = (DirectedEnergyTargetEnergyDeposition)this._directedEnergyTargetEnergyDepositionRecordList[idx];
- marshalSize += listElement.GetMarshalledSize();
- }
-
- return marshalSize;
- }
-
- ///
- /// Gets or sets the Type of Record
- ///
- [XmlElement(Type = typeof(uint), ElementName = "recordType")]
- public uint RecordType
- {
- get
- {
- return this._recordType;
- }
-
- set
- {
- this._recordType = value;
- }
- }
-
- ///
- /// Gets or sets the Length of Record
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "recordLength")]
- public ushort RecordLength
- {
- get
- {
- return this._recordLength;
- }
-
- set
- {
- this._recordLength = value;
- }
- }
-
- ///
- /// Gets or sets the Padding
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "padding")]
- public ushort Padding
- {
- get
- {
- return this._padding;
- }
-
- set
- {
- this._padding = value;
- }
- }
-
- ///
- /// Note that setting this value will not change the marshalled value. The list whose length this describes is used for that purpose.
- /// The getbeamAntennaPatternRecordCount method will also be based on the actual list length rather than this value.
- /// The method is simply here for completeness and should not be used for any computations.
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "beamAntennaPatternRecordCount")]
- public ushort BeamAntennaPatternRecordCount
- {
- get
- {
- return this._beamAntennaPatternRecordCount;
- }
-
- set
- {
- this._beamAntennaPatternRecordCount = value;
- }
- }
-
- ///
- /// Note that setting this value will not change the marshalled value. The list whose length this describes is used for that purpose.
- /// The getdirectedEnergyTargetEnergyDepositionRecordCount method will also be based on the actual list length rather than this value.
- /// The method is simply here for completeness and should not be used for any computations.
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "directedEnergyTargetEnergyDepositionRecordCount")]
- public ushort DirectedEnergyTargetEnergyDepositionRecordCount
- {
- get
- {
- return this._directedEnergyTargetEnergyDepositionRecordCount;
- }
-
- set
- {
- this._directedEnergyTargetEnergyDepositionRecordCount = value;
- }
- }
-
- ///
- /// Gets or sets the list of beam antenna records. See 6.2.9.2
- ///
- [XmlElement(ElementName = "beamAntennaParameterListList", Type = typeof(List))]
- public List BeamAntennaParameterList
- {
- get
- {
- return this._beamAntennaParameterList;
- }
- }
-
- ///
- /// Gets or sets the list of DE target deposition records. See 6.2.21.4
- ///
- [XmlElement(ElementName = "directedEnergyTargetEnergyDepositionRecordListList", Type = typeof(List))]
- public List DirectedEnergyTargetEnergyDepositionRecordList
- {
- get
- {
- return this._directedEnergyTargetEnergyDepositionRecordList;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedInt((uint)this._recordType);
- dos.WriteUnsignedShort((ushort)this._recordLength);
- dos.WriteUnsignedShort((ushort)this._padding);
- dos.WriteUnsignedShort((ushort)this._beamAntennaParameterList.Count);
- dos.WriteUnsignedShort((ushort)this._directedEnergyTargetEnergyDepositionRecordList.Count);
-
- for (int idx = 0; idx < this._beamAntennaParameterList.Count; idx++)
- {
- BeamAntennaPattern aBeamAntennaPattern = (BeamAntennaPattern)this._beamAntennaParameterList[idx];
- aBeamAntennaPattern.Marshal(dos);
- }
-
- for (int idx = 0; idx < this._directedEnergyTargetEnergyDepositionRecordList.Count; idx++)
- {
- DirectedEnergyTargetEnergyDeposition aDirectedEnergyTargetEnergyDeposition = (DirectedEnergyTargetEnergyDeposition)this._directedEnergyTargetEnergyDepositionRecordList[idx];
- aDirectedEnergyTargetEnergyDeposition.Marshal(dos);
- }
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._recordType = dis.ReadUnsignedInt();
- this._recordLength = dis.ReadUnsignedShort();
- this._padding = dis.ReadUnsignedShort();
- this._beamAntennaPatternRecordCount = dis.ReadUnsignedShort();
- this._directedEnergyTargetEnergyDepositionRecordCount = dis.ReadUnsignedShort();
- for (int idx = 0; idx < this.BeamAntennaPatternRecordCount; idx++)
- {
- BeamAntennaPattern anX = new BeamAntennaPattern();
- anX.Unmarshal(dis);
- this._beamAntennaParameterList.Add(anX);
- };
-
- for (int idx = 0; idx < this.DirectedEnergyTargetEnergyDepositionRecordCount; idx++)
- {
- DirectedEnergyTargetEnergyDeposition anX = new DirectedEnergyTargetEnergyDeposition();
- anX.Unmarshal(dis);
- this._directedEnergyTargetEnergyDepositionRecordList.Add(anX);
- };
-
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("" + this._recordType.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._recordLength.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._padding.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._beamAntennaParameterList.Count.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._directedEnergyTargetEnergyDepositionRecordList.Count.ToString(CultureInfo.InvariantCulture) + "");
- for (int idx = 0; idx < this._beamAntennaParameterList.Count; idx++)
- {
- sb.AppendLine("");
- BeamAntennaPattern aBeamAntennaPattern = (BeamAntennaPattern)this._beamAntennaParameterList[idx];
- aBeamAntennaPattern.Reflection(sb);
- sb.AppendLine("");
- }
-
- for (int idx = 0; idx < this._directedEnergyTargetEnergyDepositionRecordList.Count; idx++)
- {
- sb.AppendLine("");
- DirectedEnergyTargetEnergyDeposition aDirectedEnergyTargetEnergyDeposition = (DirectedEnergyTargetEnergyDeposition)this._directedEnergyTargetEnergyDepositionRecordList[idx];
- aDirectedEnergyTargetEnergyDeposition.Reflection(sb);
- sb.AppendLine("");
- }
-
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as DirectedEnergyAreaAimpoint;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(DirectedEnergyAreaAimpoint obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (this._recordType != obj._recordType)
- {
- ivarsEqual = false;
- }
-
- if (this._recordLength != obj._recordLength)
- {
- ivarsEqual = false;
- }
-
- if (this._padding != obj._padding)
- {
- ivarsEqual = false;
- }
-
- if (this._beamAntennaPatternRecordCount != obj._beamAntennaPatternRecordCount)
- {
- ivarsEqual = false;
- }
-
- if (this._directedEnergyTargetEnergyDepositionRecordCount != obj._directedEnergyTargetEnergyDepositionRecordCount)
- {
- ivarsEqual = false;
- }
-
- if (this._beamAntennaParameterList.Count != obj._beamAntennaParameterList.Count)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < this._beamAntennaParameterList.Count; idx++)
- {
- if (!this._beamAntennaParameterList[idx].Equals(obj._beamAntennaParameterList[idx]))
- {
- ivarsEqual = false;
- }
- }
- }
-
- if (this._directedEnergyTargetEnergyDepositionRecordList.Count != obj._directedEnergyTargetEnergyDepositionRecordList.Count)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < this._directedEnergyTargetEnergyDepositionRecordList.Count; idx++)
- {
- if (!this._directedEnergyTargetEnergyDepositionRecordList[idx].Equals(obj._directedEnergyTargetEnergyDepositionRecordList[idx]))
- {
- ivarsEqual = false;
- }
- }
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._recordType.GetHashCode();
- result = GenerateHash(result) ^ this._recordLength.GetHashCode();
- result = GenerateHash(result) ^ this._padding.GetHashCode();
- result = GenerateHash(result) ^ this._beamAntennaPatternRecordCount.GetHashCode();
- result = GenerateHash(result) ^ this._directedEnergyTargetEnergyDepositionRecordCount.GetHashCode();
-
- if (this._beamAntennaParameterList.Count > 0)
- {
- for (int idx = 0; idx < this._beamAntennaParameterList.Count; idx++)
- {
- result = GenerateHash(result) ^ this._beamAntennaParameterList[idx].GetHashCode();
- }
- }
-
- if (this._directedEnergyTargetEnergyDepositionRecordList.Count > 0)
- {
- for (int idx = 0; idx < this._directedEnergyTargetEnergyDepositionRecordList.Count; idx++)
- {
- result = GenerateHash(result) ^ this._directedEnergyTargetEnergyDepositionRecordList[idx].GetHashCode();
- }
- }
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/DirectedEnergyDamage.cs b/tests/OpenDisNet.Reference/Generated/DirectedEnergyDamage.cs
deleted file mode 100644
index f7d5330..0000000
--- a/tests/OpenDisNet.Reference/Generated/DirectedEnergyDamage.cs
+++ /dev/null
@@ -1,635 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Damage sustained by an entity due to directed energy. Location of the damage based on a relative x,y,z location from the center of the entity. Section 6.2.17.2
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(Vector3Float))]
- [XmlInclude(typeof(EventIdentifier))]
- public partial class DirectedEnergyDamage
- {
- ///
- /// DE Record Type.
- ///
- private uint _recordType = 4500;
-
- ///
- /// DE Record Length (bytes).
- ///
- private ushort _recordLength = 40;
-
- ///
- /// padding.
- ///
- private ushort _padding;
-
- ///
- /// location of damage, relative to center of entity
- ///
- private Vector3Float _damageLocation = new Vector3Float();
-
- ///
- /// Size of damaged area, in meters.
- ///
- private float _damageDiameter;
-
- ///
- /// average temp of the damaged area, in degrees celsius. If firing entitty does not model this, use a value of -273.15
- ///
- private float _temperature = -273.15F;
-
- ///
- /// enumeration
- ///
- private byte _componentIdentification;
-
- ///
- /// enumeration
- ///
- private byte _componentDamageStatus;
-
- ///
- /// enumeration
- ///
- private byte _componentVisualDamageStatus;
-
- ///
- /// enumeration
- ///
- private byte _componentVisualSmokeColor;
-
- ///
- /// For any component damage resulting this field shall be set to the fire event ID from that PDU.
- ///
- private EventIdentifier _fireEventID = new EventIdentifier();
-
- ///
- /// padding
- ///
- private ushort _padding2;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public DirectedEnergyDamage()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(DirectedEnergyDamage left, DirectedEnergyDamage right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(DirectedEnergyDamage left, DirectedEnergyDamage right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += 4; // this._recordType
- marshalSize += 2; // this._recordLength
- marshalSize += 2; // this._padding
- marshalSize += this._damageLocation.GetMarshalledSize(); // this._damageLocation
- marshalSize += 4; // this._damageDiameter
- marshalSize += 4; // this._temperature
- marshalSize += 1; // this._componentIdentification
- marshalSize += 1; // this._componentDamageStatus
- marshalSize += 1; // this._componentVisualDamageStatus
- marshalSize += 1; // this._componentVisualSmokeColor
- marshalSize += this._fireEventID.GetMarshalledSize(); // this._fireEventID
- marshalSize += 2; // this._padding2
- return marshalSize;
- }
-
- ///
- /// Gets or sets the DE Record Type.
- ///
- [XmlElement(Type = typeof(uint), ElementName = "recordType")]
- public uint RecordType
- {
- get
- {
- return this._recordType;
- }
-
- set
- {
- this._recordType = value;
- }
- }
-
- ///
- /// Gets or sets the DE Record Length (bytes).
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "recordLength")]
- public ushort RecordLength
- {
- get
- {
- return this._recordLength;
- }
-
- set
- {
- this._recordLength = value;
- }
- }
-
- ///
- /// Gets or sets the padding.
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "padding")]
- public ushort Padding
- {
- get
- {
- return this._padding;
- }
-
- set
- {
- this._padding = value;
- }
- }
-
- ///
- /// Gets or sets the location of damage, relative to center of entity
- ///
- [XmlElement(Type = typeof(Vector3Float), ElementName = "damageLocation")]
- public Vector3Float DamageLocation
- {
- get
- {
- return this._damageLocation;
- }
-
- set
- {
- this._damageLocation = value;
- }
- }
-
- ///
- /// Gets or sets the Size of damaged area, in meters.
- ///
- [XmlElement(Type = typeof(float), ElementName = "damageDiameter")]
- public float DamageDiameter
- {
- get
- {
- return this._damageDiameter;
- }
-
- set
- {
- this._damageDiameter = value;
- }
- }
-
- ///
- /// Gets or sets the average temp of the damaged area, in degrees celsius. If firing entitty does not model this, use a value of -273.15
- ///
- [XmlElement(Type = typeof(float), ElementName = "temperature")]
- public float Temperature
- {
- get
- {
- return this._temperature;
- }
-
- set
- {
- this._temperature = value;
- }
- }
-
- ///
- /// Gets or sets the enumeration
- ///
- [XmlElement(Type = typeof(byte), ElementName = "componentIdentification")]
- public byte ComponentIdentification
- {
- get
- {
- return this._componentIdentification;
- }
-
- set
- {
- this._componentIdentification = value;
- }
- }
-
- ///
- /// Gets or sets the enumeration
- ///
- [XmlElement(Type = typeof(byte), ElementName = "componentDamageStatus")]
- public byte ComponentDamageStatus
- {
- get
- {
- return this._componentDamageStatus;
- }
-
- set
- {
- this._componentDamageStatus = value;
- }
- }
-
- ///
- /// Gets or sets the enumeration
- ///
- [XmlElement(Type = typeof(byte), ElementName = "componentVisualDamageStatus")]
- public byte ComponentVisualDamageStatus
- {
- get
- {
- return this._componentVisualDamageStatus;
- }
-
- set
- {
- this._componentVisualDamageStatus = value;
- }
- }
-
- ///
- /// Gets or sets the enumeration
- ///
- [XmlElement(Type = typeof(byte), ElementName = "componentVisualSmokeColor")]
- public byte ComponentVisualSmokeColor
- {
- get
- {
- return this._componentVisualSmokeColor;
- }
-
- set
- {
- this._componentVisualSmokeColor = value;
- }
- }
-
- ///
- /// Gets or sets the For any component damage resulting this field shall be set to the fire event ID from that PDU.
- ///
- [XmlElement(Type = typeof(EventIdentifier), ElementName = "fireEventID")]
- public EventIdentifier FireEventID
- {
- get
- {
- return this._fireEventID;
- }
-
- set
- {
- this._fireEventID = value;
- }
- }
-
- ///
- /// Gets or sets the padding
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "padding2")]
- public ushort Padding2
- {
- get
- {
- return this._padding2;
- }
-
- set
- {
- this._padding2 = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedInt((uint)this._recordType);
- dos.WriteUnsignedShort((ushort)this._recordLength);
- dos.WriteUnsignedShort((ushort)this._padding);
- this._damageLocation.Marshal(dos);
- dos.WriteFloat((float)this._damageDiameter);
- dos.WriteFloat((float)this._temperature);
- dos.WriteUnsignedByte((byte)this._componentIdentification);
- dos.WriteUnsignedByte((byte)this._componentDamageStatus);
- dos.WriteUnsignedByte((byte)this._componentVisualDamageStatus);
- dos.WriteUnsignedByte((byte)this._componentVisualSmokeColor);
- this._fireEventID.Marshal(dos);
- dos.WriteUnsignedShort((ushort)this._padding2);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._recordType = dis.ReadUnsignedInt();
- this._recordLength = dis.ReadUnsignedShort();
- this._padding = dis.ReadUnsignedShort();
- this._damageLocation.Unmarshal(dis);
- this._damageDiameter = dis.ReadFloat();
- this._temperature = dis.ReadFloat();
- this._componentIdentification = dis.ReadUnsignedByte();
- this._componentDamageStatus = dis.ReadUnsignedByte();
- this._componentVisualDamageStatus = dis.ReadUnsignedByte();
- this._componentVisualSmokeColor = dis.ReadUnsignedByte();
- this._fireEventID.Unmarshal(dis);
- this._padding2 = dis.ReadUnsignedShort();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("" + this._recordType.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._recordLength.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._padding.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- this._damageLocation.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._damageDiameter.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._temperature.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._componentIdentification.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._componentDamageStatus.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._componentVisualDamageStatus.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._componentVisualSmokeColor.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- this._fireEventID.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._padding2.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as DirectedEnergyDamage;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(DirectedEnergyDamage obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (this._recordType != obj._recordType)
- {
- ivarsEqual = false;
- }
-
- if (this._recordLength != obj._recordLength)
- {
- ivarsEqual = false;
- }
-
- if (this._padding != obj._padding)
- {
- ivarsEqual = false;
- }
-
- if (!this._damageLocation.Equals(obj._damageLocation))
- {
- ivarsEqual = false;
- }
-
- if (this._damageDiameter != obj._damageDiameter)
- {
- ivarsEqual = false;
- }
-
- if (this._temperature != obj._temperature)
- {
- ivarsEqual = false;
- }
-
- if (this._componentIdentification != obj._componentIdentification)
- {
- ivarsEqual = false;
- }
-
- if (this._componentDamageStatus != obj._componentDamageStatus)
- {
- ivarsEqual = false;
- }
-
- if (this._componentVisualDamageStatus != obj._componentVisualDamageStatus)
- {
- ivarsEqual = false;
- }
-
- if (this._componentVisualSmokeColor != obj._componentVisualSmokeColor)
- {
- ivarsEqual = false;
- }
-
- if (!this._fireEventID.Equals(obj._fireEventID))
- {
- ivarsEqual = false;
- }
-
- if (this._padding2 != obj._padding2)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._recordType.GetHashCode();
- result = GenerateHash(result) ^ this._recordLength.GetHashCode();
- result = GenerateHash(result) ^ this._padding.GetHashCode();
- result = GenerateHash(result) ^ this._damageLocation.GetHashCode();
- result = GenerateHash(result) ^ this._damageDiameter.GetHashCode();
- result = GenerateHash(result) ^ this._temperature.GetHashCode();
- result = GenerateHash(result) ^ this._componentIdentification.GetHashCode();
- result = GenerateHash(result) ^ this._componentDamageStatus.GetHashCode();
- result = GenerateHash(result) ^ this._componentVisualDamageStatus.GetHashCode();
- result = GenerateHash(result) ^ this._componentVisualSmokeColor.GetHashCode();
- result = GenerateHash(result) ^ this._fireEventID.GetHashCode();
- result = GenerateHash(result) ^ this._padding2.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/DirectedEnergyFirePdu.cs b/tests/OpenDisNet.Reference/Generated/DirectedEnergyFirePdu.cs
deleted file mode 100644
index 4ce5f99..0000000
--- a/tests/OpenDisNet.Reference/Generated/DirectedEnergyFirePdu.cs
+++ /dev/null
@@ -1,809 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Firing of a directed energy weapon shall be communicated by issuing a Directed Energy Fire PDU Section 7.3.4 COMPLETE
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(EntityType))]
- [XmlInclude(typeof(ClockTime))]
- [XmlInclude(typeof(Vector3Float))]
- [XmlInclude(typeof(StandardVariableSpecification))]
- public partial class DirectedEnergyFirePdu : WarfareFamilyPdu, IEquatable
- {
- ///
- /// Field shall identify the munition type enumeration for the DE weapon beam, Section 7.3.4
- ///
- private EntityType _munitionType = new EntityType();
-
- ///
- /// Field shall indicate the simulation time at start of the shot, Section 7.3.4
- ///
- private ClockTime _shotStartTime = new ClockTime();
-
- ///
- /// Field shall indicate the current cumulative duration of the shot, Section 7.3.4
- ///
- private float _commulativeShotTime;
-
- ///
- /// Field shall identify the location of the DE weapon aperture/emitter, Section 7.3.4
- ///
- private Vector3Float _ApertureEmitterLocation = new Vector3Float();
-
- ///
- /// Field shall identify the beam diameter at the aperture/emitter, Section 7.3.4
- ///
- private float _apertureDiameter;
-
- ///
- /// Field shall identify the emissions wavelength in units of meters, Section 7.3.4
- ///
- private float _wavelength;
-
- ///
- /// Field shall identify the current peak irradiance of emissions in units of Watts per square meter, Section 7.3.4
- ///
- private float _peakIrradiance;
-
- ///
- /// field shall identify the current pulse repetition frequency in units of cycles per second (Hertz), Section 7.3.4
- ///
- private float _pulseRepetitionFrequency;
-
- ///
- /// field shall identify the pulse width emissions in units of seconds, Section 7.3.4
- ///
- private int _pulseWidth;
-
- ///
- /// 16bit Boolean field shall contain various flags to indicate status information needed to process a DE, Section 7.3.4
- ///
- private int _flags;
-
- ///
- /// Field shall identify the pulse shape and shall be represented as an 8-bit enumeration, Section 7.3.4
- ///
- private byte _pulseShape;
-
- ///
- /// padding, Section 7.3.4
- ///
- private byte _padding1;
-
- ///
- /// padding, Section 7.3.4
- ///
- private uint _padding2;
-
- ///
- /// padding, Section 7.3.4
- ///
- private ushort _padding3;
-
- ///
- /// Field shall specify the number of DE records, Section 7.3.4
- ///
- private ushort _numberOfDERecords;
-
- ///
- /// Fields shall contain one or more DE records, records shall conform to the variable record format (Section6.2.82), Section 7.3.4
- ///
- private List _dERecords = new List();
-
- ///
- /// Initializes a new instance of the class.
- ///
- public DirectedEnergyFirePdu()
- {
- PduType = (byte)68;
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(DirectedEnergyFirePdu left, DirectedEnergyFirePdu right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(DirectedEnergyFirePdu left, DirectedEnergyFirePdu right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public override int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize = base.GetMarshalledSize();
- marshalSize += this._munitionType.GetMarshalledSize(); // this._munitionType
- marshalSize += this._shotStartTime.GetMarshalledSize(); // this._shotStartTime
- marshalSize += 4; // this._commulativeShotTime
- marshalSize += this._ApertureEmitterLocation.GetMarshalledSize(); // this._ApertureEmitterLocation
- marshalSize += 4; // this._apertureDiameter
- marshalSize += 4; // this._wavelength
- marshalSize += 4; // this._peakIrradiance
- marshalSize += 4; // this._pulseRepetitionFrequency
- marshalSize += 4; // this._pulseWidth
- marshalSize += 4; // this._flags
- marshalSize += 1; // this._pulseShape
- marshalSize += 1; // this._padding1
- marshalSize += 4; // this._padding2
- marshalSize += 2; // this._padding3
- marshalSize += 2; // this._numberOfDERecords
- for (int idx = 0; idx < this._dERecords.Count; idx++)
- {
- StandardVariableSpecification listElement = (StandardVariableSpecification)this._dERecords[idx];
- marshalSize += listElement.GetMarshalledSize();
- }
-
- return marshalSize;
- }
-
- ///
- /// Gets or sets the Field shall identify the munition type enumeration for the DE weapon beam, Section 7.3.4
- ///
- [XmlElement(Type = typeof(EntityType), ElementName = "munitionType")]
- public EntityType MunitionType
- {
- get
- {
- return this._munitionType;
- }
-
- set
- {
- this._munitionType = value;
- }
- }
-
- ///
- /// Gets or sets the Field shall indicate the simulation time at start of the shot, Section 7.3.4
- ///
- [XmlElement(Type = typeof(ClockTime), ElementName = "shotStartTime")]
- public ClockTime ShotStartTime
- {
- get
- {
- return this._shotStartTime;
- }
-
- set
- {
- this._shotStartTime = value;
- }
- }
-
- ///
- /// Gets or sets the Field shall indicate the current cumulative duration of the shot, Section 7.3.4
- ///
- [XmlElement(Type = typeof(float), ElementName = "commulativeShotTime")]
- public float CommulativeShotTime
- {
- get
- {
- return this._commulativeShotTime;
- }
-
- set
- {
- this._commulativeShotTime = value;
- }
- }
-
- ///
- /// Gets or sets the Field shall identify the location of the DE weapon aperture/emitter, Section 7.3.4
- ///
- [XmlElement(Type = typeof(Vector3Float), ElementName = "ApertureEmitterLocation")]
- public Vector3Float ApertureEmitterLocation
- {
- get
- {
- return this._ApertureEmitterLocation;
- }
-
- set
- {
- this._ApertureEmitterLocation = value;
- }
- }
-
- ///
- /// Gets or sets the Field shall identify the beam diameter at the aperture/emitter, Section 7.3.4
- ///
- [XmlElement(Type = typeof(float), ElementName = "apertureDiameter")]
- public float ApertureDiameter
- {
- get
- {
- return this._apertureDiameter;
- }
-
- set
- {
- this._apertureDiameter = value;
- }
- }
-
- ///
- /// Gets or sets the Field shall identify the emissions wavelength in units of meters, Section 7.3.4
- ///
- [XmlElement(Type = typeof(float), ElementName = "wavelength")]
- public float Wavelength
- {
- get
- {
- return this._wavelength;
- }
-
- set
- {
- this._wavelength = value;
- }
- }
-
- ///
- /// Gets or sets the Field shall identify the current peak irradiance of emissions in units of Watts per square meter, Section 7.3.4
- ///
- [XmlElement(Type = typeof(float), ElementName = "peakIrradiance")]
- public float PeakIrradiance
- {
- get
- {
- return this._peakIrradiance;
- }
-
- set
- {
- this._peakIrradiance = value;
- }
- }
-
- ///
- /// Gets or sets the field shall identify the current pulse repetition frequency in units of cycles per second (Hertz), Section 7.3.4
- ///
- [XmlElement(Type = typeof(float), ElementName = "pulseRepetitionFrequency")]
- public float PulseRepetitionFrequency
- {
- get
- {
- return this._pulseRepetitionFrequency;
- }
-
- set
- {
- this._pulseRepetitionFrequency = value;
- }
- }
-
- ///
- /// Gets or sets the field shall identify the pulse width emissions in units of seconds, Section 7.3.4
- ///
- [XmlElement(Type = typeof(int), ElementName = "pulseWidth")]
- public int PulseWidth
- {
- get
- {
- return this._pulseWidth;
- }
-
- set
- {
- this._pulseWidth = value;
- }
- }
-
- ///
- /// Gets or sets the 16bit Boolean field shall contain various flags to indicate status information needed to process a DE, Section 7.3.4
- ///
- [XmlElement(Type = typeof(int), ElementName = "flags")]
- public int Flags
- {
- get
- {
- return this._flags;
- }
-
- set
- {
- this._flags = value;
- }
- }
-
- ///
- /// Gets or sets the Field shall identify the pulse shape and shall be represented as an 8-bit enumeration, Section 7.3.4
- ///
- [XmlElement(Type = typeof(byte), ElementName = "pulseShape")]
- public byte PulseShape
- {
- get
- {
- return this._pulseShape;
- }
-
- set
- {
- this._pulseShape = value;
- }
- }
-
- ///
- /// Gets or sets the padding, Section 7.3.4
- ///
- [XmlElement(Type = typeof(byte), ElementName = "padding1")]
- public byte Padding1
- {
- get
- {
- return this._padding1;
- }
-
- set
- {
- this._padding1 = value;
- }
- }
-
- ///
- /// Gets or sets the padding, Section 7.3.4
- ///
- [XmlElement(Type = typeof(uint), ElementName = "padding2")]
- public uint Padding2
- {
- get
- {
- return this._padding2;
- }
-
- set
- {
- this._padding2 = value;
- }
- }
-
- ///
- /// Gets or sets the padding, Section 7.3.4
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "padding3")]
- public ushort Padding3
- {
- get
- {
- return this._padding3;
- }
-
- set
- {
- this._padding3 = value;
- }
- }
-
- ///
- /// Note that setting this value will not change the marshalled value. The list whose length this describes is used for that purpose.
- /// The getnumberOfDERecords method will also be based on the actual list length rather than this value.
- /// The method is simply here for completeness and should not be used for any computations.
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "numberOfDERecords")]
- public ushort NumberOfDERecords
- {
- get
- {
- return this._numberOfDERecords;
- }
-
- set
- {
- this._numberOfDERecords = value;
- }
- }
-
- ///
- /// Gets or sets the Fields shall contain one or more DE records, records shall conform to the variable record format (Section6.2.82), Section 7.3.4
- ///
- [XmlElement(ElementName = "dERecordsList", Type = typeof(List))]
- public List DERecords
- {
- get
- {
- return this._dERecords;
- }
- }
-
- ///
- /// Automatically sets the length of the marshalled data, then calls the marshal method.
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- public override void MarshalAutoLengthSet(DataOutputStream dos)
- {
- // Set the length prior to marshalling data
- this.Length = (ushort)this.GetMarshalledSize();
- this.Marshal(dos);
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Marshal(DataOutputStream dos)
- {
- base.Marshal(dos);
- if (dos != null)
- {
- try
- {
- this._munitionType.Marshal(dos);
- this._shotStartTime.Marshal(dos);
- dos.WriteFloat((float)this._commulativeShotTime);
- this._ApertureEmitterLocation.Marshal(dos);
- dos.WriteFloat((float)this._apertureDiameter);
- dos.WriteFloat((float)this._wavelength);
- dos.WriteFloat((float)this._peakIrradiance);
- dos.WriteFloat((float)this._pulseRepetitionFrequency);
- dos.WriteInt((int)this._pulseWidth);
- dos.WriteInt((int)this._flags);
- dos.WriteByte((byte)this._pulseShape);
- dos.WriteUnsignedByte((byte)this._padding1);
- dos.WriteUnsignedInt((uint)this._padding2);
- dos.WriteUnsignedShort((ushort)this._padding3);
- dos.WriteUnsignedShort((ushort)this._dERecords.Count);
-
- for (int idx = 0; idx < this._dERecords.Count; idx++)
- {
- StandardVariableSpecification aStandardVariableSpecification = (StandardVariableSpecification)this._dERecords[idx];
- aStandardVariableSpecification.Marshal(dos);
- }
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Unmarshal(DataInputStream dis)
- {
- base.Unmarshal(dis);
-
- if (dis != null)
- {
- try
- {
- this._munitionType.Unmarshal(dis);
- this._shotStartTime.Unmarshal(dis);
- this._commulativeShotTime = dis.ReadFloat();
- this._ApertureEmitterLocation.Unmarshal(dis);
- this._apertureDiameter = dis.ReadFloat();
- this._wavelength = dis.ReadFloat();
- this._peakIrradiance = dis.ReadFloat();
- this._pulseRepetitionFrequency = dis.ReadFloat();
- this._pulseWidth = dis.ReadInt();
- this._flags = dis.ReadInt();
- this._pulseShape = dis.ReadByte();
- this._padding1 = dis.ReadUnsignedByte();
- this._padding2 = dis.ReadUnsignedInt();
- this._padding3 = dis.ReadUnsignedShort();
- this._numberOfDERecords = dis.ReadUnsignedShort();
- for (int idx = 0; idx < this.NumberOfDERecords; idx++)
- {
- StandardVariableSpecification anX = new StandardVariableSpecification();
- anX.Unmarshal(dis);
- this._dERecords.Add(anX);
- };
-
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- base.Reflection(sb);
- try
- {
- sb.AppendLine("");
- this._munitionType.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- this._shotStartTime.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._commulativeShotTime.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- this._ApertureEmitterLocation.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._apertureDiameter.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._wavelength.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._peakIrradiance.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._pulseRepetitionFrequency.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._pulseWidth.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._flags.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._pulseShape.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._padding1.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._padding2.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._padding3.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._dERecords.Count.ToString(CultureInfo.InvariantCulture) + "");
- for (int idx = 0; idx < this._dERecords.Count; idx++)
- {
- sb.AppendLine("");
- StandardVariableSpecification aStandardVariableSpecification = (StandardVariableSpecification)this._dERecords[idx];
- aStandardVariableSpecification.Reflection(sb);
- sb.AppendLine("");
- }
-
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as DirectedEnergyFirePdu;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(DirectedEnergyFirePdu obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- ivarsEqual = base.Equals(obj);
-
- if (!this._munitionType.Equals(obj._munitionType))
- {
- ivarsEqual = false;
- }
-
- if (!this._shotStartTime.Equals(obj._shotStartTime))
- {
- ivarsEqual = false;
- }
-
- if (this._commulativeShotTime != obj._commulativeShotTime)
- {
- ivarsEqual = false;
- }
-
- if (!this._ApertureEmitterLocation.Equals(obj._ApertureEmitterLocation))
- {
- ivarsEqual = false;
- }
-
- if (this._apertureDiameter != obj._apertureDiameter)
- {
- ivarsEqual = false;
- }
-
- if (this._wavelength != obj._wavelength)
- {
- ivarsEqual = false;
- }
-
- if (this._peakIrradiance != obj._peakIrradiance)
- {
- ivarsEqual = false;
- }
-
- if (this._pulseRepetitionFrequency != obj._pulseRepetitionFrequency)
- {
- ivarsEqual = false;
- }
-
- if (this._pulseWidth != obj._pulseWidth)
- {
- ivarsEqual = false;
- }
-
- if (this._flags != obj._flags)
- {
- ivarsEqual = false;
- }
-
- if (this._pulseShape != obj._pulseShape)
- {
- ivarsEqual = false;
- }
-
- if (this._padding1 != obj._padding1)
- {
- ivarsEqual = false;
- }
-
- if (this._padding2 != obj._padding2)
- {
- ivarsEqual = false;
- }
-
- if (this._padding3 != obj._padding3)
- {
- ivarsEqual = false;
- }
-
- if (this._numberOfDERecords != obj._numberOfDERecords)
- {
- ivarsEqual = false;
- }
-
- if (this._dERecords.Count != obj._dERecords.Count)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < this._dERecords.Count; idx++)
- {
- if (!this._dERecords[idx].Equals(obj._dERecords[idx]))
- {
- ivarsEqual = false;
- }
- }
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ base.GetHashCode();
-
- result = GenerateHash(result) ^ this._munitionType.GetHashCode();
- result = GenerateHash(result) ^ this._shotStartTime.GetHashCode();
- result = GenerateHash(result) ^ this._commulativeShotTime.GetHashCode();
- result = GenerateHash(result) ^ this._ApertureEmitterLocation.GetHashCode();
- result = GenerateHash(result) ^ this._apertureDiameter.GetHashCode();
- result = GenerateHash(result) ^ this._wavelength.GetHashCode();
- result = GenerateHash(result) ^ this._peakIrradiance.GetHashCode();
- result = GenerateHash(result) ^ this._pulseRepetitionFrequency.GetHashCode();
- result = GenerateHash(result) ^ this._pulseWidth.GetHashCode();
- result = GenerateHash(result) ^ this._flags.GetHashCode();
- result = GenerateHash(result) ^ this._pulseShape.GetHashCode();
- result = GenerateHash(result) ^ this._padding1.GetHashCode();
- result = GenerateHash(result) ^ this._padding2.GetHashCode();
- result = GenerateHash(result) ^ this._padding3.GetHashCode();
- result = GenerateHash(result) ^ this._numberOfDERecords.GetHashCode();
-
- if (this._dERecords.Count > 0)
- {
- for (int idx = 0; idx < this._dERecords.Count; idx++)
- {
- result = GenerateHash(result) ^ this._dERecords[idx].GetHashCode();
- }
- }
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/DirectedEnergyPrecisionAimpoint.cs b/tests/OpenDisNet.Reference/Generated/DirectedEnergyPrecisionAimpoint.cs
deleted file mode 100644
index 1eeda49..0000000
--- a/tests/OpenDisNet.Reference/Generated/DirectedEnergyPrecisionAimpoint.cs
+++ /dev/null
@@ -1,674 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// DE Precision Aimpoint Record. Section 6.2.21.3
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(Vector3Double))]
- [XmlInclude(typeof(Vector3Float))]
- [XmlInclude(typeof(EntityID))]
- public partial class DirectedEnergyPrecisionAimpoint
- {
- ///
- /// Type of Record
- ///
- private uint _recordType = 4000;
-
- ///
- /// Length of Record
- ///
- private ushort _recordLength = 88;
-
- ///
- /// Padding
- ///
- private ushort _padding;
-
- ///
- /// Position of Target Spot in World Coordinates.
- ///
- private Vector3Double _targetSpotLocation = new Vector3Double();
-
- ///
- /// Position (meters) of Target Spot relative to Entity Position.
- ///
- private Vector3Float _targetSpotEntityLocation = new Vector3Float();
-
- ///
- /// Velocity (meters/sec) of Target Spot.
- ///
- private Vector3Float _targetSpotVelocity = new Vector3Float();
-
- ///
- /// Acceleration (meters/sec/sec) of Target Spot.
- ///
- private Vector3Float _targetSpotAcceleration = new Vector3Float();
-
- ///
- /// Unique ID of the target entity.
- ///
- private EntityID _targetEntityID = new EntityID();
-
- ///
- /// Target Component ID ENUM, same as in DamageDescriptionRecord.
- ///
- private byte _targetComponentID;
-
- ///
- /// Spot Shape ENUM.
- ///
- private byte _SpotShape;
-
- ///
- /// Beam Spot Cross Section Semi-Major Axis.
- ///
- private float _BeamSpotXSecSemiMajorAxis;
-
- ///
- /// Beam Spot Cross Section Semi-Major Axis.
- ///
- private float _BeamSpotCrossSectionSemiMinorAxis;
-
- ///
- /// Beam Spot Cross Section Orientation Angle.
- ///
- private float _BeamSpotCrossSectionOrientAngle;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public DirectedEnergyPrecisionAimpoint()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(DirectedEnergyPrecisionAimpoint left, DirectedEnergyPrecisionAimpoint right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(DirectedEnergyPrecisionAimpoint left, DirectedEnergyPrecisionAimpoint right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += 4; // this._recordType
- marshalSize += 2; // this._recordLength
- marshalSize += 2; // this._padding
- marshalSize += this._targetSpotLocation.GetMarshalledSize(); // this._targetSpotLocation
- marshalSize += this._targetSpotEntityLocation.GetMarshalledSize(); // this._targetSpotEntityLocation
- marshalSize += this._targetSpotVelocity.GetMarshalledSize(); // this._targetSpotVelocity
- marshalSize += this._targetSpotAcceleration.GetMarshalledSize(); // this._targetSpotAcceleration
- marshalSize += this._targetEntityID.GetMarshalledSize(); // this._targetEntityID
- marshalSize += 1; // this._targetComponentID
- marshalSize += 1; // this._SpotShape
- marshalSize += 4; // this._BeamSpotXSecSemiMajorAxis
- marshalSize += 4; // this._BeamSpotCrossSectionSemiMinorAxis
- marshalSize += 4; // this._BeamSpotCrossSectionOrientAngle
- return marshalSize;
- }
-
- ///
- /// Gets or sets the Type of Record
- ///
- [XmlElement(Type = typeof(uint), ElementName = "recordType")]
- public uint RecordType
- {
- get
- {
- return this._recordType;
- }
-
- set
- {
- this._recordType = value;
- }
- }
-
- ///
- /// Gets or sets the Length of Record
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "recordLength")]
- public ushort RecordLength
- {
- get
- {
- return this._recordLength;
- }
-
- set
- {
- this._recordLength = value;
- }
- }
-
- ///
- /// Gets or sets the Padding
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "padding")]
- public ushort Padding
- {
- get
- {
- return this._padding;
- }
-
- set
- {
- this._padding = value;
- }
- }
-
- ///
- /// Gets or sets the Position of Target Spot in World Coordinates.
- ///
- [XmlElement(Type = typeof(Vector3Double), ElementName = "targetSpotLocation")]
- public Vector3Double TargetSpotLocation
- {
- get
- {
- return this._targetSpotLocation;
- }
-
- set
- {
- this._targetSpotLocation = value;
- }
- }
-
- ///
- /// Gets or sets the Position (meters) of Target Spot relative to Entity Position.
- ///
- [XmlElement(Type = typeof(Vector3Float), ElementName = "targetSpotEntityLocation")]
- public Vector3Float TargetSpotEntityLocation
- {
- get
- {
- return this._targetSpotEntityLocation;
- }
-
- set
- {
- this._targetSpotEntityLocation = value;
- }
- }
-
- ///
- /// Gets or sets the Velocity (meters/sec) of Target Spot.
- ///
- [XmlElement(Type = typeof(Vector3Float), ElementName = "targetSpotVelocity")]
- public Vector3Float TargetSpotVelocity
- {
- get
- {
- return this._targetSpotVelocity;
- }
-
- set
- {
- this._targetSpotVelocity = value;
- }
- }
-
- ///
- /// Gets or sets the Acceleration (meters/sec/sec) of Target Spot.
- ///
- [XmlElement(Type = typeof(Vector3Float), ElementName = "targetSpotAcceleration")]
- public Vector3Float TargetSpotAcceleration
- {
- get
- {
- return this._targetSpotAcceleration;
- }
-
- set
- {
- this._targetSpotAcceleration = value;
- }
- }
-
- ///
- /// Gets or sets the Unique ID of the target entity.
- ///
- [XmlElement(Type = typeof(EntityID), ElementName = "targetEntityID")]
- public EntityID TargetEntityID
- {
- get
- {
- return this._targetEntityID;
- }
-
- set
- {
- this._targetEntityID = value;
- }
- }
-
- ///
- /// Gets or sets the Target Component ID ENUM, same as in DamageDescriptionRecord.
- ///
- [XmlElement(Type = typeof(byte), ElementName = "targetComponentID")]
- public byte TargetComponentID
- {
- get
- {
- return this._targetComponentID;
- }
-
- set
- {
- this._targetComponentID = value;
- }
- }
-
- ///
- /// Gets or sets the Spot Shape ENUM.
- ///
- [XmlElement(Type = typeof(byte), ElementName = "SpotShape")]
- public byte SpotShape
- {
- get
- {
- return this._SpotShape;
- }
-
- set
- {
- this._SpotShape = value;
- }
- }
-
- ///
- /// Gets or sets the Beam Spot Cross Section Semi-Major Axis.
- ///
- [XmlElement(Type = typeof(float), ElementName = "BeamSpotXSecSemiMajorAxis")]
- public float BeamSpotXSecSemiMajorAxis
- {
- get
- {
- return this._BeamSpotXSecSemiMajorAxis;
- }
-
- set
- {
- this._BeamSpotXSecSemiMajorAxis = value;
- }
- }
-
- ///
- /// Gets or sets the Beam Spot Cross Section Semi-Major Axis.
- ///
- [XmlElement(Type = typeof(float), ElementName = "BeamSpotCrossSectionSemiMinorAxis")]
- public float BeamSpotCrossSectionSemiMinorAxis
- {
- get
- {
- return this._BeamSpotCrossSectionSemiMinorAxis;
- }
-
- set
- {
- this._BeamSpotCrossSectionSemiMinorAxis = value;
- }
- }
-
- ///
- /// Gets or sets the Beam Spot Cross Section Orientation Angle.
- ///
- [XmlElement(Type = typeof(float), ElementName = "BeamSpotCrossSectionOrientAngle")]
- public float BeamSpotCrossSectionOrientAngle
- {
- get
- {
- return this._BeamSpotCrossSectionOrientAngle;
- }
-
- set
- {
- this._BeamSpotCrossSectionOrientAngle = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedInt((uint)this._recordType);
- dos.WriteUnsignedShort((ushort)this._recordLength);
- dos.WriteUnsignedShort((ushort)this._padding);
- this._targetSpotLocation.Marshal(dos);
- this._targetSpotEntityLocation.Marshal(dos);
- this._targetSpotVelocity.Marshal(dos);
- this._targetSpotAcceleration.Marshal(dos);
- this._targetEntityID.Marshal(dos);
- dos.WriteUnsignedByte((byte)this._targetComponentID);
- dos.WriteUnsignedByte((byte)this._SpotShape);
- dos.WriteFloat((float)this._BeamSpotXSecSemiMajorAxis);
- dos.WriteFloat((float)this._BeamSpotCrossSectionSemiMinorAxis);
- dos.WriteFloat((float)this._BeamSpotCrossSectionOrientAngle);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._recordType = dis.ReadUnsignedInt();
- this._recordLength = dis.ReadUnsignedShort();
- this._padding = dis.ReadUnsignedShort();
- this._targetSpotLocation.Unmarshal(dis);
- this._targetSpotEntityLocation.Unmarshal(dis);
- this._targetSpotVelocity.Unmarshal(dis);
- this._targetSpotAcceleration.Unmarshal(dis);
- this._targetEntityID.Unmarshal(dis);
- this._targetComponentID = dis.ReadUnsignedByte();
- this._SpotShape = dis.ReadUnsignedByte();
- this._BeamSpotXSecSemiMajorAxis = dis.ReadFloat();
- this._BeamSpotCrossSectionSemiMinorAxis = dis.ReadFloat();
- this._BeamSpotCrossSectionOrientAngle = dis.ReadFloat();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("" + this._recordType.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._recordLength.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._padding.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- this._targetSpotLocation.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- this._targetSpotEntityLocation.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- this._targetSpotVelocity.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- this._targetSpotAcceleration.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- this._targetEntityID.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._targetComponentID.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._SpotShape.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._BeamSpotXSecSemiMajorAxis.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._BeamSpotCrossSectionSemiMinorAxis.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._BeamSpotCrossSectionOrientAngle.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as DirectedEnergyPrecisionAimpoint;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(DirectedEnergyPrecisionAimpoint obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (this._recordType != obj._recordType)
- {
- ivarsEqual = false;
- }
-
- if (this._recordLength != obj._recordLength)
- {
- ivarsEqual = false;
- }
-
- if (this._padding != obj._padding)
- {
- ivarsEqual = false;
- }
-
- if (!this._targetSpotLocation.Equals(obj._targetSpotLocation))
- {
- ivarsEqual = false;
- }
-
- if (!this._targetSpotEntityLocation.Equals(obj._targetSpotEntityLocation))
- {
- ivarsEqual = false;
- }
-
- if (!this._targetSpotVelocity.Equals(obj._targetSpotVelocity))
- {
- ivarsEqual = false;
- }
-
- if (!this._targetSpotAcceleration.Equals(obj._targetSpotAcceleration))
- {
- ivarsEqual = false;
- }
-
- if (!this._targetEntityID.Equals(obj._targetEntityID))
- {
- ivarsEqual = false;
- }
-
- if (this._targetComponentID != obj._targetComponentID)
- {
- ivarsEqual = false;
- }
-
- if (this._SpotShape != obj._SpotShape)
- {
- ivarsEqual = false;
- }
-
- if (this._BeamSpotXSecSemiMajorAxis != obj._BeamSpotXSecSemiMajorAxis)
- {
- ivarsEqual = false;
- }
-
- if (this._BeamSpotCrossSectionSemiMinorAxis != obj._BeamSpotCrossSectionSemiMinorAxis)
- {
- ivarsEqual = false;
- }
-
- if (this._BeamSpotCrossSectionOrientAngle != obj._BeamSpotCrossSectionOrientAngle)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._recordType.GetHashCode();
- result = GenerateHash(result) ^ this._recordLength.GetHashCode();
- result = GenerateHash(result) ^ this._padding.GetHashCode();
- result = GenerateHash(result) ^ this._targetSpotLocation.GetHashCode();
- result = GenerateHash(result) ^ this._targetSpotEntityLocation.GetHashCode();
- result = GenerateHash(result) ^ this._targetSpotVelocity.GetHashCode();
- result = GenerateHash(result) ^ this._targetSpotAcceleration.GetHashCode();
- result = GenerateHash(result) ^ this._targetEntityID.GetHashCode();
- result = GenerateHash(result) ^ this._targetComponentID.GetHashCode();
- result = GenerateHash(result) ^ this._SpotShape.GetHashCode();
- result = GenerateHash(result) ^ this._BeamSpotXSecSemiMajorAxis.GetHashCode();
- result = GenerateHash(result) ^ this._BeamSpotCrossSectionSemiMinorAxis.GetHashCode();
- result = GenerateHash(result) ^ this._BeamSpotCrossSectionOrientAngle.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/DirectedEnergyTargetEnergyDeposition.cs b/tests/OpenDisNet.Reference/Generated/DirectedEnergyTargetEnergyDeposition.cs
deleted file mode 100644
index 1b0a133..0000000
--- a/tests/OpenDisNet.Reference/Generated/DirectedEnergyTargetEnergyDeposition.cs
+++ /dev/null
@@ -1,344 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// DE energy depostion properties for a target entity. Section 6.2.21.4
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(EntityID))]
- public partial class DirectedEnergyTargetEnergyDeposition
- {
- ///
- /// Unique ID of the target entity.
- ///
- private EntityID _targetEntityID = new EntityID();
-
- ///
- /// padding
- ///
- private ushort _padding;
-
- ///
- /// Peak irrandiance
- ///
- private float _peakIrradiance;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public DirectedEnergyTargetEnergyDeposition()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(DirectedEnergyTargetEnergyDeposition left, DirectedEnergyTargetEnergyDeposition right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(DirectedEnergyTargetEnergyDeposition left, DirectedEnergyTargetEnergyDeposition right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += this._targetEntityID.GetMarshalledSize(); // this._targetEntityID
- marshalSize += 2; // this._padding
- marshalSize += 4; // this._peakIrradiance
- return marshalSize;
- }
-
- ///
- /// Gets or sets the Unique ID of the target entity.
- ///
- [XmlElement(Type = typeof(EntityID), ElementName = "targetEntityID")]
- public EntityID TargetEntityID
- {
- get
- {
- return this._targetEntityID;
- }
-
- set
- {
- this._targetEntityID = value;
- }
- }
-
- ///
- /// Gets or sets the padding
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "padding")]
- public ushort Padding
- {
- get
- {
- return this._padding;
- }
-
- set
- {
- this._padding = value;
- }
- }
-
- ///
- /// Gets or sets the Peak irrandiance
- ///
- [XmlElement(Type = typeof(float), ElementName = "peakIrradiance")]
- public float PeakIrradiance
- {
- get
- {
- return this._peakIrradiance;
- }
-
- set
- {
- this._peakIrradiance = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- this._targetEntityID.Marshal(dos);
- dos.WriteUnsignedShort((ushort)this._padding);
- dos.WriteFloat((float)this._peakIrradiance);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._targetEntityID.Unmarshal(dis);
- this._padding = dis.ReadUnsignedShort();
- this._peakIrradiance = dis.ReadFloat();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("");
- this._targetEntityID.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._padding.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._peakIrradiance.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as DirectedEnergyTargetEnergyDeposition;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(DirectedEnergyTargetEnergyDeposition obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (!this._targetEntityID.Equals(obj._targetEntityID))
- {
- ivarsEqual = false;
- }
-
- if (this._padding != obj._padding)
- {
- ivarsEqual = false;
- }
-
- if (this._peakIrradiance != obj._peakIrradiance)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._targetEntityID.GetHashCode();
- result = GenerateHash(result) ^ this._padding.GetHashCode();
- result = GenerateHash(result) ^ this._peakIrradiance.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/DistributedEmissionsFamilyPdu.cs b/tests/OpenDisNet.Reference/Generated/DistributedEmissionsFamilyPdu.cs
deleted file mode 100644
index 1afa67b..0000000
--- a/tests/OpenDisNet.Reference/Generated/DistributedEmissionsFamilyPdu.cs
+++ /dev/null
@@ -1,248 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Section 5.3.7. Electronic Emissions. Abstract superclass for distirubted emissions PDU
- ///
- [Serializable]
- [XmlRoot]
- public partial class DistributedEmissionsFamilyPdu : Pdu, IEquatable
- {
- ///
- /// Initializes a new instance of the class.
- ///
- public DistributedEmissionsFamilyPdu()
- {
- ProtocolFamily = (byte)6;
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(DistributedEmissionsFamilyPdu left, DistributedEmissionsFamilyPdu right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(DistributedEmissionsFamilyPdu left, DistributedEmissionsFamilyPdu right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public override int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize = base.GetMarshalledSize();
- return marshalSize;
- }
-
- ///
- /// Automatically sets the length of the marshalled data, then calls the marshal method.
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- public virtual void MarshalAutoLengthSet(DataOutputStream dos)
- {
- // Set the length prior to marshalling data
- this.Length = (ushort)this.GetMarshalledSize();
- this.Marshal(dos);
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Marshal(DataOutputStream dos)
- {
- base.Marshal(dos);
- if (dos != null)
- {
- try
- {
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Unmarshal(DataInputStream dis)
- {
- base.Unmarshal(dis);
-
- if (dis != null)
- {
- try
- {
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- base.Reflection(sb);
- try
- {
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as DistributedEmissionsFamilyPdu;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(DistributedEmissionsFamilyPdu obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- ivarsEqual = base.Equals(obj);
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ base.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/EEFundamentalParameterData.cs b/tests/OpenDisNet.Reference/Generated/EEFundamentalParameterData.cs
deleted file mode 100644
index d6d6483..0000000
--- a/tests/OpenDisNet.Reference/Generated/EEFundamentalParameterData.cs
+++ /dev/null
@@ -1,405 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Contains electromagnetic emmission regeneration parameters that are variable throught a scenario. Section 6.2.22.
- ///
- [Serializable]
- [XmlRoot]
- public partial class EEFundamentalParameterData
- {
- ///
- /// center frequency of the emission in hertz.
- ///
- private float _frequency;
-
- ///
- /// Bandwidth of the frequencies corresponding to the fequency field.
- ///
- private float _frequencyRange;
-
- ///
- /// Effective radiated power for the emission in DdBm. For a radar noise jammer, indicates the peak of the transmitted power.
- ///
- private float _effectiveRadiatedPower;
-
- ///
- /// Average repetition frequency of the emission in hertz.
- ///
- private float _pulseRepetitionFrequency;
-
- ///
- /// Average pulse width of the emission in microseconds.
- ///
- private float _pulseWidth;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public EEFundamentalParameterData()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(EEFundamentalParameterData left, EEFundamentalParameterData right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(EEFundamentalParameterData left, EEFundamentalParameterData right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += 4; // this._frequency
- marshalSize += 4; // this._frequencyRange
- marshalSize += 4; // this._effectiveRadiatedPower
- marshalSize += 4; // this._pulseRepetitionFrequency
- marshalSize += 4; // this._pulseWidth
- return marshalSize;
- }
-
- ///
- /// Gets or sets the center frequency of the emission in hertz.
- ///
- [XmlElement(Type = typeof(float), ElementName = "frequency")]
- public float Frequency
- {
- get
- {
- return this._frequency;
- }
-
- set
- {
- this._frequency = value;
- }
- }
-
- ///
- /// Gets or sets the Bandwidth of the frequencies corresponding to the fequency field.
- ///
- [XmlElement(Type = typeof(float), ElementName = "frequencyRange")]
- public float FrequencyRange
- {
- get
- {
- return this._frequencyRange;
- }
-
- set
- {
- this._frequencyRange = value;
- }
- }
-
- ///
- /// Gets or sets the Effective radiated power for the emission in DdBm. For a radar noise jammer, indicates the peak of the transmitted power.
- ///
- [XmlElement(Type = typeof(float), ElementName = "effectiveRadiatedPower")]
- public float EffectiveRadiatedPower
- {
- get
- {
- return this._effectiveRadiatedPower;
- }
-
- set
- {
- this._effectiveRadiatedPower = value;
- }
- }
-
- ///
- /// Gets or sets the Average repetition frequency of the emission in hertz.
- ///
- [XmlElement(Type = typeof(float), ElementName = "pulseRepetitionFrequency")]
- public float PulseRepetitionFrequency
- {
- get
- {
- return this._pulseRepetitionFrequency;
- }
-
- set
- {
- this._pulseRepetitionFrequency = value;
- }
- }
-
- ///
- /// Gets or sets the Average pulse width of the emission in microseconds.
- ///
- [XmlElement(Type = typeof(float), ElementName = "pulseWidth")]
- public float PulseWidth
- {
- get
- {
- return this._pulseWidth;
- }
-
- set
- {
- this._pulseWidth = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- dos.WriteFloat((float)this._frequency);
- dos.WriteFloat((float)this._frequencyRange);
- dos.WriteFloat((float)this._effectiveRadiatedPower);
- dos.WriteFloat((float)this._pulseRepetitionFrequency);
- dos.WriteFloat((float)this._pulseWidth);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._frequency = dis.ReadFloat();
- this._frequencyRange = dis.ReadFloat();
- this._effectiveRadiatedPower = dis.ReadFloat();
- this._pulseRepetitionFrequency = dis.ReadFloat();
- this._pulseWidth = dis.ReadFloat();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("" + this._frequency.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._frequencyRange.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._effectiveRadiatedPower.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._pulseRepetitionFrequency.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._pulseWidth.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as EEFundamentalParameterData;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(EEFundamentalParameterData obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (this._frequency != obj._frequency)
- {
- ivarsEqual = false;
- }
-
- if (this._frequencyRange != obj._frequencyRange)
- {
- ivarsEqual = false;
- }
-
- if (this._effectiveRadiatedPower != obj._effectiveRadiatedPower)
- {
- ivarsEqual = false;
- }
-
- if (this._pulseRepetitionFrequency != obj._pulseRepetitionFrequency)
- {
- ivarsEqual = false;
- }
-
- if (this._pulseWidth != obj._pulseWidth)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._frequency.GetHashCode();
- result = GenerateHash(result) ^ this._frequencyRange.GetHashCode();
- result = GenerateHash(result) ^ this._effectiveRadiatedPower.GetHashCode();
- result = GenerateHash(result) ^ this._pulseRepetitionFrequency.GetHashCode();
- result = GenerateHash(result) ^ this._pulseWidth.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/EightByteChunk.cs b/tests/OpenDisNet.Reference/Generated/EightByteChunk.cs
deleted file mode 100644
index 188fa8d..0000000
--- a/tests/OpenDisNet.Reference/Generated/EightByteChunk.cs
+++ /dev/null
@@ -1,303 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// 64 bit piece of data
- ///
- [Serializable]
- [XmlRoot]
- public partial class EightByteChunk
- {
- ///
- /// Eight bytes of arbitrary data
- ///
- private byte[] _otherParameters = new byte[8];
-
- ///
- /// Initializes a new instance of the class.
- ///
- public EightByteChunk()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(EightByteChunk left, EightByteChunk right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(EightByteChunk left, EightByteChunk right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += 8 * 1; // _otherParameters
- return marshalSize;
- }
-
- ///
- /// Gets or sets the Eight bytes of arbitrary data
- ///
- [XmlArray(ElementName = "otherParameters")]
- public byte[] OtherParameters
- {
- get
- {
- return this._otherParameters;
- }
-
- set
- {
- this._otherParameters = value;
- }
-}
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
-
- for (int idx = 0; idx < this._otherParameters.Length; idx++)
- {
- dos.WriteByte(this._otherParameters[idx]);
- }
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- for (int idx = 0; idx < this._otherParameters.Length; idx++)
- {
- this._otherParameters[idx] = dis.ReadByte();
- }
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- for (int idx = 0; idx < this._otherParameters.Length; idx++)
- {
- sb.AppendLine("" + this._otherParameters[idx] + "");
- }
-
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as EightByteChunk;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(EightByteChunk obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (obj._otherParameters.Length != 8)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < 8; idx++)
- {
- if (this._otherParameters[idx] != obj._otherParameters[idx])
- {
- ivarsEqual = false;
- }
- }
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
-
- for (int idx = 0; idx < 8; idx++)
- {
- result = GenerateHash(result) ^ this._otherParameters[idx].GetHashCode();
- }
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/ElectronicEmissionsPdu.cs b/tests/OpenDisNet.Reference/Generated/ElectronicEmissionsPdu.cs
deleted file mode 100644
index 35133a0..0000000
--- a/tests/OpenDisNet.Reference/Generated/ElectronicEmissionsPdu.cs
+++ /dev/null
@@ -1,620 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Section 5.3.7.1. Information about active electronic warfare (EW) emissions and active EW countermeasures shall be communicated using an Electromagnetic Emission PDU. NOT COMPLETE
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(EntityID))]
- [XmlInclude(typeof(EventIdentifier))]
- [XmlInclude(typeof(EmitterSystem))]
- [XmlInclude(typeof(Vector3Float))]
- [XmlInclude(typeof(Vector3Float))]
- public partial class ElectronicEmissionsPdu : DistributedEmissionsFamilyPdu, IEquatable
- {
- ///
- /// ID of the entity emitting
- ///
- private EntityID _emittingEntityID = new EntityID();
-
- ///
- /// ID of event
- ///
- private EventIdentifier _eventID = new EventIdentifier();
-
- ///
- /// This field shall be used to indicate if the data in the PDU represents a state update or just data that has changed since issuance of the last Electromagnetic Emission PDU [relative to the identified entity and emission system(s)].
- ///
- private byte _stateUpdateIndicator;
-
- ///
- /// This field shall specify the number of emission systems being described in the current PDU.
- ///
- private byte _numberOfSystems;
-
- ///
- /// padding
- ///
- private ushort _paddingForEmissionsPdu;
-
- ///
- /// this field shall specify the length of this emitter system's data in 32-bit words.
- ///
- private byte _systemDataLength;
-
- ///
- /// the number of beams being described in the current PDU for the emitter system being described.
- ///
- private byte _numberOfBeams;
-
- ///
- /// information about a particular emitter system and shall be represented by an Emitter System record (see 6.2.23).
- ///
- private EmitterSystem _emitterSystem = new EmitterSystem();
-
- ///
- /// the location of the antenna beam source with respect to the emitting entity's coordinate system. This location shall be the origin of the emitter coordinate system that shall have the same orientation as the entity coordinate system. This field shall be represented by an Entity Coordinate Vector record see 6.2.95
- ///
- private Vector3Float _location = new Vector3Float();
-
- ///
- /// Electronic emmissions systems THIS IS WRONG. It has the WRONG class type and will cause problems in any marshalling.
- ///
- private List _systems = new List();
-
- ///
- /// Initializes a new instance of the class.
- ///
- public ElectronicEmissionsPdu()
- {
- PduType = (byte)23;
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(ElectronicEmissionsPdu left, ElectronicEmissionsPdu right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(ElectronicEmissionsPdu left, ElectronicEmissionsPdu right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public override int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize = base.GetMarshalledSize();
- marshalSize += this._emittingEntityID.GetMarshalledSize(); // this._emittingEntityID
- marshalSize += this._eventID.GetMarshalledSize(); // this._eventID
- marshalSize += 1; // this._stateUpdateIndicator
- marshalSize += 1; // this._numberOfSystems
- marshalSize += 2; // this._paddingForEmissionsPdu
- marshalSize += 1; // this._systemDataLength
- marshalSize += 1; // this._numberOfBeams
- marshalSize += this._emitterSystem.GetMarshalledSize(); // this._emitterSystem
- marshalSize += this._location.GetMarshalledSize(); // this._location
- for (int idx = 0; idx < this._systems.Count; idx++)
- {
- Vector3Float listElement = (Vector3Float)this._systems[idx];
- marshalSize += listElement.GetMarshalledSize();
- }
-
- return marshalSize;
- }
-
- ///
- /// Gets or sets the ID of the entity emitting
- ///
- [XmlElement(Type = typeof(EntityID), ElementName = "emittingEntityID")]
- public EntityID EmittingEntityID
- {
- get
- {
- return this._emittingEntityID;
- }
-
- set
- {
- this._emittingEntityID = value;
- }
- }
-
- ///
- /// Gets or sets the ID of event
- ///
- [XmlElement(Type = typeof(EventIdentifier), ElementName = "eventID")]
- public EventIdentifier EventID
- {
- get
- {
- return this._eventID;
- }
-
- set
- {
- this._eventID = value;
- }
- }
-
- ///
- /// Gets or sets the This field shall be used to indicate if the data in the PDU represents a state update or just data that has changed since issuance of the last Electromagnetic Emission PDU [relative to the identified entity and emission system(s)].
- ///
- [XmlElement(Type = typeof(byte), ElementName = "stateUpdateIndicator")]
- public byte StateUpdateIndicator
- {
- get
- {
- return this._stateUpdateIndicator;
- }
-
- set
- {
- this._stateUpdateIndicator = value;
- }
- }
-
- ///
- /// Note that setting this value will not change the marshalled value. The list whose length this describes is used for that purpose.
- /// The getnumberOfSystems method will also be based on the actual list length rather than this value.
- /// The method is simply here for completeness and should not be used for any computations.
- ///
- [XmlElement(Type = typeof(byte), ElementName = "numberOfSystems")]
- public byte NumberOfSystems
- {
- get
- {
- return this._numberOfSystems;
- }
-
- set
- {
- this._numberOfSystems = value;
- }
- }
-
- ///
- /// Gets or sets the padding
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "paddingForEmissionsPdu")]
- public ushort PaddingForEmissionsPdu
- {
- get
- {
- return this._paddingForEmissionsPdu;
- }
-
- set
- {
- this._paddingForEmissionsPdu = value;
- }
- }
-
- ///
- /// Gets or sets the this field shall specify the length of this emitter system's data in 32-bit words.
- ///
- [XmlElement(Type = typeof(byte), ElementName = "systemDataLength")]
- public byte SystemDataLength
- {
- get
- {
- return this._systemDataLength;
- }
-
- set
- {
- this._systemDataLength = value;
- }
- }
-
- ///
- /// Gets or sets the the number of beams being described in the current PDU for the emitter system being described.
- ///
- [XmlElement(Type = typeof(byte), ElementName = "numberOfBeams")]
- public byte NumberOfBeams
- {
- get
- {
- return this._numberOfBeams;
- }
-
- set
- {
- this._numberOfBeams = value;
- }
- }
-
- ///
- /// Gets or sets the information about a particular emitter system and shall be represented by an Emitter System record (see 6.2.23).
- ///
- [XmlElement(Type = typeof(EmitterSystem), ElementName = "emitterSystem")]
- public EmitterSystem EmitterSystem
- {
- get
- {
- return this._emitterSystem;
- }
-
- set
- {
- this._emitterSystem = value;
- }
- }
-
- ///
- /// Gets or sets the the location of the antenna beam source with respect to the emitting entity's coordinate system. This location shall be the origin of the emitter coordinate system that shall have the same orientation as the entity coordinate system. This field shall be represented by an Entity Coordinate Vector record see 6.2.95
- ///
- [XmlElement(Type = typeof(Vector3Float), ElementName = "location")]
- public Vector3Float Location
- {
- get
- {
- return this._location;
- }
-
- set
- {
- this._location = value;
- }
- }
-
- ///
- /// Gets or sets the Electronic emmissions systems THIS IS WRONG. It has the WRONG class type and will cause problems in any marshalling.
- ///
- [XmlElement(ElementName = "systemsList", Type = typeof(List))]
- public List Systems
- {
- get
- {
- return this._systems;
- }
- }
-
- ///
- /// Automatically sets the length of the marshalled data, then calls the marshal method.
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- public override void MarshalAutoLengthSet(DataOutputStream dos)
- {
- // Set the length prior to marshalling data
- this.Length = (ushort)this.GetMarshalledSize();
- this.Marshal(dos);
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Marshal(DataOutputStream dos)
- {
- base.Marshal(dos);
- if (dos != null)
- {
- try
- {
- this._emittingEntityID.Marshal(dos);
- this._eventID.Marshal(dos);
- dos.WriteUnsignedByte((byte)this._stateUpdateIndicator);
- dos.WriteUnsignedByte((byte)this._systems.Count);
- dos.WriteUnsignedShort((ushort)this._paddingForEmissionsPdu);
- dos.WriteUnsignedByte((byte)this._systemDataLength);
- dos.WriteUnsignedByte((byte)this._numberOfBeams);
- this._emitterSystem.Marshal(dos);
- this._location.Marshal(dos);
-
- for (int idx = 0; idx < this._systems.Count; idx++)
- {
- Vector3Float aVector3Float = (Vector3Float)this._systems[idx];
- aVector3Float.Marshal(dos);
- }
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Unmarshal(DataInputStream dis)
- {
- base.Unmarshal(dis);
-
- if (dis != null)
- {
- try
- {
- this._emittingEntityID.Unmarshal(dis);
- this._eventID.Unmarshal(dis);
- this._stateUpdateIndicator = dis.ReadUnsignedByte();
- this._numberOfSystems = dis.ReadUnsignedByte();
- this._paddingForEmissionsPdu = dis.ReadUnsignedShort();
- this._systemDataLength = dis.ReadUnsignedByte();
- this._numberOfBeams = dis.ReadUnsignedByte();
- this._emitterSystem.Unmarshal(dis);
- this._location.Unmarshal(dis);
- for (int idx = 0; idx < this.NumberOfSystems; idx++)
- {
- Vector3Float anX = new Vector3Float();
- anX.Unmarshal(dis);
- this._systems.Add(anX);
- };
-
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- base.Reflection(sb);
- try
- {
- sb.AppendLine("");
- this._emittingEntityID.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- this._eventID.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._stateUpdateIndicator.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._systems.Count.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._paddingForEmissionsPdu.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._systemDataLength.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._numberOfBeams.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- this._emitterSystem.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- this._location.Reflection(sb);
- sb.AppendLine("");
- for (int idx = 0; idx < this._systems.Count; idx++)
- {
- sb.AppendLine("");
- Vector3Float aVector3Float = (Vector3Float)this._systems[idx];
- aVector3Float.Reflection(sb);
- sb.AppendLine("");
- }
-
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as ElectronicEmissionsPdu;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(ElectronicEmissionsPdu obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- ivarsEqual = base.Equals(obj);
-
- if (!this._emittingEntityID.Equals(obj._emittingEntityID))
- {
- ivarsEqual = false;
- }
-
- if (!this._eventID.Equals(obj._eventID))
- {
- ivarsEqual = false;
- }
-
- if (this._stateUpdateIndicator != obj._stateUpdateIndicator)
- {
- ivarsEqual = false;
- }
-
- if (this._numberOfSystems != obj._numberOfSystems)
- {
- ivarsEqual = false;
- }
-
- if (this._paddingForEmissionsPdu != obj._paddingForEmissionsPdu)
- {
- ivarsEqual = false;
- }
-
- if (this._systemDataLength != obj._systemDataLength)
- {
- ivarsEqual = false;
- }
-
- if (this._numberOfBeams != obj._numberOfBeams)
- {
- ivarsEqual = false;
- }
-
- if (!this._emitterSystem.Equals(obj._emitterSystem))
- {
- ivarsEqual = false;
- }
-
- if (!this._location.Equals(obj._location))
- {
- ivarsEqual = false;
- }
-
- if (this._systems.Count != obj._systems.Count)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < this._systems.Count; idx++)
- {
- if (!this._systems[idx].Equals(obj._systems[idx]))
- {
- ivarsEqual = false;
- }
- }
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ base.GetHashCode();
-
- result = GenerateHash(result) ^ this._emittingEntityID.GetHashCode();
- result = GenerateHash(result) ^ this._eventID.GetHashCode();
- result = GenerateHash(result) ^ this._stateUpdateIndicator.GetHashCode();
- result = GenerateHash(result) ^ this._numberOfSystems.GetHashCode();
- result = GenerateHash(result) ^ this._paddingForEmissionsPdu.GetHashCode();
- result = GenerateHash(result) ^ this._systemDataLength.GetHashCode();
- result = GenerateHash(result) ^ this._numberOfBeams.GetHashCode();
- result = GenerateHash(result) ^ this._emitterSystem.GetHashCode();
- result = GenerateHash(result) ^ this._location.GetHashCode();
-
- if (this._systems.Count > 0)
- {
- for (int idx = 0; idx < this._systems.Count; idx++)
- {
- result = GenerateHash(result) ^ this._systems[idx].GetHashCode();
- }
- }
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/EmitterSystem.cs b/tests/OpenDisNet.Reference/Generated/EmitterSystem.cs
deleted file mode 100644
index 102f3f9..0000000
--- a/tests/OpenDisNet.Reference/Generated/EmitterSystem.cs
+++ /dev/null
@@ -1,341 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// This field shall specify information about a particular emitter system. Section 6.2.23.
- ///
- [Serializable]
- [XmlRoot]
- public partial class EmitterSystem
- {
- ///
- /// Name of the emitter, 16 bit enumeration
- ///
- private ushort _emitterName;
-
- ///
- /// function of the emitter, 8 bit enumeration
- ///
- private byte _function;
-
- ///
- /// emitter ID, 8 bit enumeration
- ///
- private byte _emitterIdNumber;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public EmitterSystem()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(EmitterSystem left, EmitterSystem right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(EmitterSystem left, EmitterSystem right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += 2; // this._emitterName
- marshalSize += 1; // this._function
- marshalSize += 1; // this._emitterIdNumber
- return marshalSize;
- }
-
- ///
- /// Gets or sets the Name of the emitter, 16 bit enumeration
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "emitterName")]
- public ushort EmitterName
- {
- get
- {
- return this._emitterName;
- }
-
- set
- {
- this._emitterName = value;
- }
- }
-
- ///
- /// Gets or sets the function of the emitter, 8 bit enumeration
- ///
- [XmlElement(Type = typeof(byte), ElementName = "function")]
- public byte Function
- {
- get
- {
- return this._function;
- }
-
- set
- {
- this._function = value;
- }
- }
-
- ///
- /// Gets or sets the emitter ID, 8 bit enumeration
- ///
- [XmlElement(Type = typeof(byte), ElementName = "emitterIdNumber")]
- public byte EmitterIdNumber
- {
- get
- {
- return this._emitterIdNumber;
- }
-
- set
- {
- this._emitterIdNumber = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedShort((ushort)this._emitterName);
- dos.WriteUnsignedByte((byte)this._function);
- dos.WriteUnsignedByte((byte)this._emitterIdNumber);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._emitterName = dis.ReadUnsignedShort();
- this._function = dis.ReadUnsignedByte();
- this._emitterIdNumber = dis.ReadUnsignedByte();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("" + this._emitterName.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._function.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._emitterIdNumber.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as EmitterSystem;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(EmitterSystem obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (this._emitterName != obj._emitterName)
- {
- ivarsEqual = false;
- }
-
- if (this._function != obj._function)
- {
- ivarsEqual = false;
- }
-
- if (this._emitterIdNumber != obj._emitterIdNumber)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._emitterName.GetHashCode();
- result = GenerateHash(result) ^ this._function.GetHashCode();
- result = GenerateHash(result) ^ this._emitterIdNumber.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/EngineFuel.cs b/tests/OpenDisNet.Reference/Generated/EngineFuel.cs
deleted file mode 100644
index ee06643..0000000
--- a/tests/OpenDisNet.Reference/Generated/EngineFuel.cs
+++ /dev/null
@@ -1,405 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Information about an entity's engine fuel. Section 6.2.24.
- ///
- [Serializable]
- [XmlRoot]
- public partial class EngineFuel
- {
- ///
- /// Fuel quantity, units specified by next field
- ///
- private uint _fuelQuantity;
-
- ///
- /// Units in which the fuel is measured
- ///
- private byte _fuelMeasurementUnits;
-
- ///
- /// Type of fuel
- ///
- private byte _fuelType;
-
- ///
- /// Location of fuel as related to entity. See section 14 of EBV document
- ///
- private byte _fuelLocation;
-
- ///
- /// padding
- ///
- private byte _padding;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public EngineFuel()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(EngineFuel left, EngineFuel right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(EngineFuel left, EngineFuel right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += 4; // this._fuelQuantity
- marshalSize += 1; // this._fuelMeasurementUnits
- marshalSize += 1; // this._fuelType
- marshalSize += 1; // this._fuelLocation
- marshalSize += 1; // this._padding
- return marshalSize;
- }
-
- ///
- /// Gets or sets the Fuel quantity, units specified by next field
- ///
- [XmlElement(Type = typeof(uint), ElementName = "fuelQuantity")]
- public uint FuelQuantity
- {
- get
- {
- return this._fuelQuantity;
- }
-
- set
- {
- this._fuelQuantity = value;
- }
- }
-
- ///
- /// Gets or sets the Units in which the fuel is measured
- ///
- [XmlElement(Type = typeof(byte), ElementName = "fuelMeasurementUnits")]
- public byte FuelMeasurementUnits
- {
- get
- {
- return this._fuelMeasurementUnits;
- }
-
- set
- {
- this._fuelMeasurementUnits = value;
- }
- }
-
- ///
- /// Gets or sets the Type of fuel
- ///
- [XmlElement(Type = typeof(byte), ElementName = "fuelType")]
- public byte FuelType
- {
- get
- {
- return this._fuelType;
- }
-
- set
- {
- this._fuelType = value;
- }
- }
-
- ///
- /// Gets or sets the Location of fuel as related to entity. See section 14 of EBV document
- ///
- [XmlElement(Type = typeof(byte), ElementName = "fuelLocation")]
- public byte FuelLocation
- {
- get
- {
- return this._fuelLocation;
- }
-
- set
- {
- this._fuelLocation = value;
- }
- }
-
- ///
- /// Gets or sets the padding
- ///
- [XmlElement(Type = typeof(byte), ElementName = "padding")]
- public byte Padding
- {
- get
- {
- return this._padding;
- }
-
- set
- {
- this._padding = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedInt((uint)this._fuelQuantity);
- dos.WriteUnsignedByte((byte)this._fuelMeasurementUnits);
- dos.WriteUnsignedByte((byte)this._fuelType);
- dos.WriteUnsignedByte((byte)this._fuelLocation);
- dos.WriteUnsignedByte((byte)this._padding);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._fuelQuantity = dis.ReadUnsignedInt();
- this._fuelMeasurementUnits = dis.ReadUnsignedByte();
- this._fuelType = dis.ReadUnsignedByte();
- this._fuelLocation = dis.ReadUnsignedByte();
- this._padding = dis.ReadUnsignedByte();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("" + this._fuelQuantity.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._fuelMeasurementUnits.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._fuelType.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._fuelLocation.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._padding.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as EngineFuel;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(EngineFuel obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (this._fuelQuantity != obj._fuelQuantity)
- {
- ivarsEqual = false;
- }
-
- if (this._fuelMeasurementUnits != obj._fuelMeasurementUnits)
- {
- ivarsEqual = false;
- }
-
- if (this._fuelType != obj._fuelType)
- {
- ivarsEqual = false;
- }
-
- if (this._fuelLocation != obj._fuelLocation)
- {
- ivarsEqual = false;
- }
-
- if (this._padding != obj._padding)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._fuelQuantity.GetHashCode();
- result = GenerateHash(result) ^ this._fuelMeasurementUnits.GetHashCode();
- result = GenerateHash(result) ^ this._fuelType.GetHashCode();
- result = GenerateHash(result) ^ this._fuelLocation.GetHashCode();
- result = GenerateHash(result) ^ this._padding.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/EngineFuelReload.cs b/tests/OpenDisNet.Reference/Generated/EngineFuelReload.cs
deleted file mode 100644
index 9685423..0000000
--- a/tests/OpenDisNet.Reference/Generated/EngineFuelReload.cs
+++ /dev/null
@@ -1,469 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// For each type or location of engine fuell, this record specifies the type, location, fuel measurement units, and reload quantity and maximum quantity. Section 6.2.25.
- ///
- [Serializable]
- [XmlRoot]
- public partial class EngineFuelReload
- {
- ///
- /// standard quantity of fuel loaded
- ///
- private uint _standardQuantity;
-
- ///
- /// maximum quantity of fuel loaded
- ///
- private uint _maximumQuantity;
-
- ///
- /// seconds normally required to to reload standard qty
- ///
- private uint _standardQuantityReloadTime;
-
- ///
- /// seconds normally required to to reload maximum qty
- ///
- private uint _maximumQuantityReloadTime;
-
- ///
- /// Units of measure
- ///
- private byte _fuelMeasurmentUnits;
-
- ///
- /// fuel location as related to the entity
- ///
- private byte _fuelLocation;
-
- ///
- /// padding
- ///
- private byte _padding;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public EngineFuelReload()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(EngineFuelReload left, EngineFuelReload right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(EngineFuelReload left, EngineFuelReload right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += 4; // this._standardQuantity
- marshalSize += 4; // this._maximumQuantity
- marshalSize += 4; // this._standardQuantityReloadTime
- marshalSize += 4; // this._maximumQuantityReloadTime
- marshalSize += 1; // this._fuelMeasurmentUnits
- marshalSize += 1; // this._fuelLocation
- marshalSize += 1; // this._padding
- return marshalSize;
- }
-
- ///
- /// Gets or sets the standard quantity of fuel loaded
- ///
- [XmlElement(Type = typeof(uint), ElementName = "standardQuantity")]
- public uint StandardQuantity
- {
- get
- {
- return this._standardQuantity;
- }
-
- set
- {
- this._standardQuantity = value;
- }
- }
-
- ///
- /// Gets or sets the maximum quantity of fuel loaded
- ///
- [XmlElement(Type = typeof(uint), ElementName = "maximumQuantity")]
- public uint MaximumQuantity
- {
- get
- {
- return this._maximumQuantity;
- }
-
- set
- {
- this._maximumQuantity = value;
- }
- }
-
- ///
- /// Gets or sets the seconds normally required to to reload standard qty
- ///
- [XmlElement(Type = typeof(uint), ElementName = "standardQuantityReloadTime")]
- public uint StandardQuantityReloadTime
- {
- get
- {
- return this._standardQuantityReloadTime;
- }
-
- set
- {
- this._standardQuantityReloadTime = value;
- }
- }
-
- ///
- /// Gets or sets the seconds normally required to to reload maximum qty
- ///
- [XmlElement(Type = typeof(uint), ElementName = "maximumQuantityReloadTime")]
- public uint MaximumQuantityReloadTime
- {
- get
- {
- return this._maximumQuantityReloadTime;
- }
-
- set
- {
- this._maximumQuantityReloadTime = value;
- }
- }
-
- ///
- /// Gets or sets the Units of measure
- ///
- [XmlElement(Type = typeof(byte), ElementName = "fuelMeasurmentUnits")]
- public byte FuelMeasurmentUnits
- {
- get
- {
- return this._fuelMeasurmentUnits;
- }
-
- set
- {
- this._fuelMeasurmentUnits = value;
- }
- }
-
- ///
- /// Gets or sets the fuel location as related to the entity
- ///
- [XmlElement(Type = typeof(byte), ElementName = "fuelLocation")]
- public byte FuelLocation
- {
- get
- {
- return this._fuelLocation;
- }
-
- set
- {
- this._fuelLocation = value;
- }
- }
-
- ///
- /// Gets or sets the padding
- ///
- [XmlElement(Type = typeof(byte), ElementName = "padding")]
- public byte Padding
- {
- get
- {
- return this._padding;
- }
-
- set
- {
- this._padding = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedInt((uint)this._standardQuantity);
- dos.WriteUnsignedInt((uint)this._maximumQuantity);
- dos.WriteUnsignedInt((uint)this._standardQuantityReloadTime);
- dos.WriteUnsignedInt((uint)this._maximumQuantityReloadTime);
- dos.WriteUnsignedByte((byte)this._fuelMeasurmentUnits);
- dos.WriteUnsignedByte((byte)this._fuelLocation);
- dos.WriteUnsignedByte((byte)this._padding);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._standardQuantity = dis.ReadUnsignedInt();
- this._maximumQuantity = dis.ReadUnsignedInt();
- this._standardQuantityReloadTime = dis.ReadUnsignedInt();
- this._maximumQuantityReloadTime = dis.ReadUnsignedInt();
- this._fuelMeasurmentUnits = dis.ReadUnsignedByte();
- this._fuelLocation = dis.ReadUnsignedByte();
- this._padding = dis.ReadUnsignedByte();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("" + this._standardQuantity.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._maximumQuantity.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._standardQuantityReloadTime.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._maximumQuantityReloadTime.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._fuelMeasurmentUnits.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._fuelLocation.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._padding.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as EngineFuelReload;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(EngineFuelReload obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (this._standardQuantity != obj._standardQuantity)
- {
- ivarsEqual = false;
- }
-
- if (this._maximumQuantity != obj._maximumQuantity)
- {
- ivarsEqual = false;
- }
-
- if (this._standardQuantityReloadTime != obj._standardQuantityReloadTime)
- {
- ivarsEqual = false;
- }
-
- if (this._maximumQuantityReloadTime != obj._maximumQuantityReloadTime)
- {
- ivarsEqual = false;
- }
-
- if (this._fuelMeasurmentUnits != obj._fuelMeasurmentUnits)
- {
- ivarsEqual = false;
- }
-
- if (this._fuelLocation != obj._fuelLocation)
- {
- ivarsEqual = false;
- }
-
- if (this._padding != obj._padding)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._standardQuantity.GetHashCode();
- result = GenerateHash(result) ^ this._maximumQuantity.GetHashCode();
- result = GenerateHash(result) ^ this._standardQuantityReloadTime.GetHashCode();
- result = GenerateHash(result) ^ this._maximumQuantityReloadTime.GetHashCode();
- result = GenerateHash(result) ^ this._fuelMeasurmentUnits.GetHashCode();
- result = GenerateHash(result) ^ this._fuelLocation.GetHashCode();
- result = GenerateHash(result) ^ this._padding.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/EntityAssociation.cs b/tests/OpenDisNet.Reference/Generated/EntityAssociation.cs
deleted file mode 100644
index 4e89f43..0000000
--- a/tests/OpenDisNet.Reference/Generated/EntityAssociation.cs
+++ /dev/null
@@ -1,536 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Association or disassociation of two entities. Section 6.2.93.4
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(EntityID))]
- public partial class EntityAssociation
- {
- ///
- /// the identification of the Variable Parameter record. Enumeration from EBV
- ///
- private byte _recordType = 2;
-
- ///
- /// Indicates if this VP has changed since last issuance
- ///
- private byte _changeIndicator;
-
- ///
- /// Indicates association status between two entities; 8 bit enum
- ///
- private byte _associationStatus;
-
- ///
- /// Type of association; 8 bit enum
- ///
- private byte _associationType;
-
- ///
- /// Object ID of entity associated with this entity
- ///
- private EntityID _entityID = new EntityID();
-
- ///
- /// Station location on one's own entity. EBV doc.
- ///
- private ushort _owsSttionLocation;
-
- ///
- /// Type of physical connection. EBV doc
- ///
- private ushort _physicalConnectionType;
-
- ///
- /// Type of member the entity is within th egroup
- ///
- private byte _groupMemberType;
-
- ///
- /// Group if any to which the entity belongs
- ///
- private ushort _groupNumber;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public EntityAssociation()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(EntityAssociation left, EntityAssociation right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(EntityAssociation left, EntityAssociation right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += 1; // this._recordType
- marshalSize += 1; // this._changeIndicator
- marshalSize += 1; // this._associationStatus
- marshalSize += 1; // this._associationType
- marshalSize += this._entityID.GetMarshalledSize(); // this._entityID
- marshalSize += 2; // this._owsSttionLocation
- marshalSize += 2; // this._physicalConnectionType
- marshalSize += 1; // this._groupMemberType
- marshalSize += 2; // this._groupNumber
- return marshalSize;
- }
-
- ///
- /// Gets or sets the the identification of the Variable Parameter record. Enumeration from EBV
- ///
- [XmlElement(Type = typeof(byte), ElementName = "recordType")]
- public byte RecordType
- {
- get
- {
- return this._recordType;
- }
-
- set
- {
- this._recordType = value;
- }
- }
-
- ///
- /// Gets or sets the Indicates if this VP has changed since last issuance
- ///
- [XmlElement(Type = typeof(byte), ElementName = "changeIndicator")]
- public byte ChangeIndicator
- {
- get
- {
- return this._changeIndicator;
- }
-
- set
- {
- this._changeIndicator = value;
- }
- }
-
- ///
- /// Gets or sets the Indicates association status between two entities; 8 bit enum
- ///
- [XmlElement(Type = typeof(byte), ElementName = "associationStatus")]
- public byte AssociationStatus
- {
- get
- {
- return this._associationStatus;
- }
-
- set
- {
- this._associationStatus = value;
- }
- }
-
- ///
- /// Gets or sets the Type of association; 8 bit enum
- ///
- [XmlElement(Type = typeof(byte), ElementName = "associationType")]
- public byte AssociationType
- {
- get
- {
- return this._associationType;
- }
-
- set
- {
- this._associationType = value;
- }
- }
-
- ///
- /// Gets or sets the Object ID of entity associated with this entity
- ///
- [XmlElement(Type = typeof(EntityID), ElementName = "entityID")]
- public EntityID EntityID
- {
- get
- {
- return this._entityID;
- }
-
- set
- {
- this._entityID = value;
- }
- }
-
- ///
- /// Gets or sets the Station location on one's own entity. EBV doc.
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "owsSttionLocation")]
- public ushort OwsSttionLocation
- {
- get
- {
- return this._owsSttionLocation;
- }
-
- set
- {
- this._owsSttionLocation = value;
- }
- }
-
- ///
- /// Gets or sets the Type of physical connection. EBV doc
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "physicalConnectionType")]
- public ushort PhysicalConnectionType
- {
- get
- {
- return this._physicalConnectionType;
- }
-
- set
- {
- this._physicalConnectionType = value;
- }
- }
-
- ///
- /// Gets or sets the Type of member the entity is within th egroup
- ///
- [XmlElement(Type = typeof(byte), ElementName = "groupMemberType")]
- public byte GroupMemberType
- {
- get
- {
- return this._groupMemberType;
- }
-
- set
- {
- this._groupMemberType = value;
- }
- }
-
- ///
- /// Gets or sets the Group if any to which the entity belongs
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "groupNumber")]
- public ushort GroupNumber
- {
- get
- {
- return this._groupNumber;
- }
-
- set
- {
- this._groupNumber = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedByte((byte)this._recordType);
- dos.WriteUnsignedByte((byte)this._changeIndicator);
- dos.WriteUnsignedByte((byte)this._associationStatus);
- dos.WriteUnsignedByte((byte)this._associationType);
- this._entityID.Marshal(dos);
- dos.WriteUnsignedShort((ushort)this._owsSttionLocation);
- dos.WriteUnsignedShort((ushort)this._physicalConnectionType);
- dos.WriteUnsignedByte((byte)this._groupMemberType);
- dos.WriteUnsignedShort((ushort)this._groupNumber);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._recordType = dis.ReadUnsignedByte();
- this._changeIndicator = dis.ReadUnsignedByte();
- this._associationStatus = dis.ReadUnsignedByte();
- this._associationType = dis.ReadUnsignedByte();
- this._entityID.Unmarshal(dis);
- this._owsSttionLocation = dis.ReadUnsignedShort();
- this._physicalConnectionType = dis.ReadUnsignedShort();
- this._groupMemberType = dis.ReadUnsignedByte();
- this._groupNumber = dis.ReadUnsignedShort();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("" + this._recordType.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._changeIndicator.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._associationStatus.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._associationType.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- this._entityID.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._owsSttionLocation.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._physicalConnectionType.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._groupMemberType.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._groupNumber.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as EntityAssociation;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(EntityAssociation obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (this._recordType != obj._recordType)
- {
- ivarsEqual = false;
- }
-
- if (this._changeIndicator != obj._changeIndicator)
- {
- ivarsEqual = false;
- }
-
- if (this._associationStatus != obj._associationStatus)
- {
- ivarsEqual = false;
- }
-
- if (this._associationType != obj._associationType)
- {
- ivarsEqual = false;
- }
-
- if (!this._entityID.Equals(obj._entityID))
- {
- ivarsEqual = false;
- }
-
- if (this._owsSttionLocation != obj._owsSttionLocation)
- {
- ivarsEqual = false;
- }
-
- if (this._physicalConnectionType != obj._physicalConnectionType)
- {
- ivarsEqual = false;
- }
-
- if (this._groupMemberType != obj._groupMemberType)
- {
- ivarsEqual = false;
- }
-
- if (this._groupNumber != obj._groupNumber)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._recordType.GetHashCode();
- result = GenerateHash(result) ^ this._changeIndicator.GetHashCode();
- result = GenerateHash(result) ^ this._associationStatus.GetHashCode();
- result = GenerateHash(result) ^ this._associationType.GetHashCode();
- result = GenerateHash(result) ^ this._entityID.GetHashCode();
- result = GenerateHash(result) ^ this._owsSttionLocation.GetHashCode();
- result = GenerateHash(result) ^ this._physicalConnectionType.GetHashCode();
- result = GenerateHash(result) ^ this._groupMemberType.GetHashCode();
- result = GenerateHash(result) ^ this._groupNumber.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/EntityDamageStatusPdu.cs b/tests/OpenDisNet.Reference/Generated/EntityDamageStatusPdu.cs
deleted file mode 100644
index 061469b..0000000
--- a/tests/OpenDisNet.Reference/Generated/EntityDamageStatusPdu.cs
+++ /dev/null
@@ -1,451 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// shall be used to communicate detailed damage information sustained by an entity regardless of the source of the damage Section 7.3.5 COMPLETE
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(EntityID))]
- [XmlInclude(typeof(DirectedEnergyDamage))]
- public partial class EntityDamageStatusPdu : WarfareFamilyPdu, IEquatable
- {
- ///
- /// Field shall identify the damaged entity (see 6.2.28), Section 7.3.4 COMPLETE
- ///
- private EntityID _damagedEntityID = new EntityID();
-
- ///
- /// Padding.
- ///
- private ushort _padding1;
-
- ///
- /// Padding.
- ///
- private ushort _padding2;
-
- ///
- /// field shall specify the number of Damage Description records, Section 7.3.5
- ///
- private ushort _numberOfDamageDescription;
-
- ///
- /// Fields shall contain one or more Damage Description records (see 6.2.17) and may contain other Standard Variable records, Section 7.3.5
- ///
- private List _damageDescriptionRecords = new List();
-
- ///
- /// Initializes a new instance of the class.
- ///
- public EntityDamageStatusPdu()
- {
- PduType = (byte)69;
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(EntityDamageStatusPdu left, EntityDamageStatusPdu right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(EntityDamageStatusPdu left, EntityDamageStatusPdu right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public override int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize = base.GetMarshalledSize();
- marshalSize += this._damagedEntityID.GetMarshalledSize(); // this._damagedEntityID
- marshalSize += 2; // this._padding1
- marshalSize += 2; // this._padding2
- marshalSize += 2; // this._numberOfDamageDescription
- for (int idx = 0; idx < this._damageDescriptionRecords.Count; idx++)
- {
- DirectedEnergyDamage listElement = (DirectedEnergyDamage)this._damageDescriptionRecords[idx];
- marshalSize += listElement.GetMarshalledSize();
- }
-
- return marshalSize;
- }
-
- ///
- /// Gets or sets the Field shall identify the damaged entity (see 6.2.28), Section 7.3.4 COMPLETE
- ///
- [XmlElement(Type = typeof(EntityID), ElementName = "damagedEntityID")]
- public EntityID DamagedEntityID
- {
- get
- {
- return this._damagedEntityID;
- }
-
- set
- {
- this._damagedEntityID = value;
- }
- }
-
- ///
- /// Gets or sets the Padding.
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "padding1")]
- public ushort Padding1
- {
- get
- {
- return this._padding1;
- }
-
- set
- {
- this._padding1 = value;
- }
- }
-
- ///
- /// Gets or sets the Padding.
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "padding2")]
- public ushort Padding2
- {
- get
- {
- return this._padding2;
- }
-
- set
- {
- this._padding2 = value;
- }
- }
-
- ///
- /// Note that setting this value will not change the marshalled value. The list whose length this describes is used for that purpose.
- /// The getnumberOfDamageDescription method will also be based on the actual list length rather than this value.
- /// The method is simply here for completeness and should not be used for any computations.
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "numberOfDamageDescription")]
- public ushort NumberOfDamageDescription
- {
- get
- {
- return this._numberOfDamageDescription;
- }
-
- set
- {
- this._numberOfDamageDescription = value;
- }
- }
-
- ///
- /// Gets or sets the Fields shall contain one or more Damage Description records (see 6.2.17) and may contain other Standard Variable records, Section 7.3.5
- ///
- [XmlElement(ElementName = "damageDescriptionRecordsList", Type = typeof(List))]
- public List DamageDescriptionRecords
- {
- get
- {
- return this._damageDescriptionRecords;
- }
- }
-
- ///
- /// Automatically sets the length of the marshalled data, then calls the marshal method.
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- public override void MarshalAutoLengthSet(DataOutputStream dos)
- {
- // Set the length prior to marshalling data
- this.Length = (ushort)this.GetMarshalledSize();
- this.Marshal(dos);
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Marshal(DataOutputStream dos)
- {
- base.Marshal(dos);
- if (dos != null)
- {
- try
- {
- this._damagedEntityID.Marshal(dos);
- dos.WriteUnsignedShort((ushort)this._padding1);
- dos.WriteUnsignedShort((ushort)this._padding2);
- dos.WriteUnsignedShort((ushort)this._damageDescriptionRecords.Count);
-
- for (int idx = 0; idx < this._damageDescriptionRecords.Count; idx++)
- {
- DirectedEnergyDamage aDirectedEnergyDamage = (DirectedEnergyDamage)this._damageDescriptionRecords[idx];
- aDirectedEnergyDamage.Marshal(dos);
- }
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Unmarshal(DataInputStream dis)
- {
- base.Unmarshal(dis);
-
- if (dis != null)
- {
- try
- {
- this._damagedEntityID.Unmarshal(dis);
- this._padding1 = dis.ReadUnsignedShort();
- this._padding2 = dis.ReadUnsignedShort();
- this._numberOfDamageDescription = dis.ReadUnsignedShort();
- for (int idx = 0; idx < this.NumberOfDamageDescription; idx++)
- {
- DirectedEnergyDamage anX = new DirectedEnergyDamage();
- anX.Unmarshal(dis);
- this._damageDescriptionRecords.Add(anX);
- };
-
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- base.Reflection(sb);
- try
- {
- sb.AppendLine("");
- this._damagedEntityID.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._padding1.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._padding2.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._damageDescriptionRecords.Count.ToString(CultureInfo.InvariantCulture) + "");
- for (int idx = 0; idx < this._damageDescriptionRecords.Count; idx++)
- {
- sb.AppendLine("");
- DirectedEnergyDamage aDirectedEnergyDamage = (DirectedEnergyDamage)this._damageDescriptionRecords[idx];
- aDirectedEnergyDamage.Reflection(sb);
- sb.AppendLine("");
- }
-
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as EntityDamageStatusPdu;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(EntityDamageStatusPdu obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- ivarsEqual = base.Equals(obj);
-
- if (!this._damagedEntityID.Equals(obj._damagedEntityID))
- {
- ivarsEqual = false;
- }
-
- if (this._padding1 != obj._padding1)
- {
- ivarsEqual = false;
- }
-
- if (this._padding2 != obj._padding2)
- {
- ivarsEqual = false;
- }
-
- if (this._numberOfDamageDescription != obj._numberOfDamageDescription)
- {
- ivarsEqual = false;
- }
-
- if (this._damageDescriptionRecords.Count != obj._damageDescriptionRecords.Count)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < this._damageDescriptionRecords.Count; idx++)
- {
- if (!this._damageDescriptionRecords[idx].Equals(obj._damageDescriptionRecords[idx]))
- {
- ivarsEqual = false;
- }
- }
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ base.GetHashCode();
-
- result = GenerateHash(result) ^ this._damagedEntityID.GetHashCode();
- result = GenerateHash(result) ^ this._padding1.GetHashCode();
- result = GenerateHash(result) ^ this._padding2.GetHashCode();
- result = GenerateHash(result) ^ this._numberOfDamageDescription.GetHashCode();
-
- if (this._damageDescriptionRecords.Count > 0)
- {
- for (int idx = 0; idx < this._damageDescriptionRecords.Count; idx++)
- {
- result = GenerateHash(result) ^ this._damageDescriptionRecords[idx].GetHashCode();
- }
- }
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/EntityID.cs b/tests/OpenDisNet.Reference/Generated/EntityID.cs
deleted file mode 100644
index dcada8d..0000000
--- a/tests/OpenDisNet.Reference/Generated/EntityID.cs
+++ /dev/null
@@ -1,312 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Entity Identifier. Unique ID for entities in the world. Consists of an simulation address and a entity number. Section 6.2.28.
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(SimulationAddress))]
- public partial class EntityID
- {
- ///
- /// Site and application IDs
- ///
- private SimulationAddress _simulationAddress = new SimulationAddress();
-
- ///
- /// Entity number
- ///
- private ushort _entityNumber;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public EntityID()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(EntityID left, EntityID right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(EntityID left, EntityID right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += this._simulationAddress.GetMarshalledSize(); // this._simulationAddress
- marshalSize += 2; // this._entityNumber
- return marshalSize;
- }
-
- ///
- /// Gets or sets the Site and application IDs
- ///
- [XmlElement(Type = typeof(SimulationAddress), ElementName = "simulationAddress")]
- public SimulationAddress SimulationAddress
- {
- get
- {
- return this._simulationAddress;
- }
-
- set
- {
- this._simulationAddress = value;
- }
- }
-
- ///
- /// Gets or sets the Entity number
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "entityNumber")]
- public ushort EntityNumber
- {
- get
- {
- return this._entityNumber;
- }
-
- set
- {
- this._entityNumber = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- this._simulationAddress.Marshal(dos);
- dos.WriteUnsignedShort((ushort)this._entityNumber);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._simulationAddress.Unmarshal(dis);
- this._entityNumber = dis.ReadUnsignedShort();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("");
- this._simulationAddress.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._entityNumber.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as EntityID;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(EntityID obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (!this._simulationAddress.Equals(obj._simulationAddress))
- {
- ivarsEqual = false;
- }
-
- if (this._entityNumber != obj._entityNumber)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._simulationAddress.GetHashCode();
- result = GenerateHash(result) ^ this._entityNumber.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/EntityInformationFamilyPdu.cs b/tests/OpenDisNet.Reference/Generated/EntityInformationFamilyPdu.cs
deleted file mode 100644
index 1670732..0000000
--- a/tests/OpenDisNet.Reference/Generated/EntityInformationFamilyPdu.cs
+++ /dev/null
@@ -1,248 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Section 5.3.3. Common superclass for EntityState, Collision, collision-elastic, and entity state update PDUs. This should be abstract. COMPLETE
- ///
- [Serializable]
- [XmlRoot]
- public partial class EntityInformationFamilyPdu : Pdu, IEquatable
- {
- ///
- /// Initializes a new instance of the class.
- ///
- public EntityInformationFamilyPdu()
- {
- ProtocolFamily = (byte)1;
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(EntityInformationFamilyPdu left, EntityInformationFamilyPdu right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(EntityInformationFamilyPdu left, EntityInformationFamilyPdu right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public override int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize = base.GetMarshalledSize();
- return marshalSize;
- }
-
- ///
- /// Automatically sets the length of the marshalled data, then calls the marshal method.
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- public virtual void MarshalAutoLengthSet(DataOutputStream dos)
- {
- // Set the length prior to marshalling data
- this.Length = (ushort)this.GetMarshalledSize();
- this.Marshal(dos);
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Marshal(DataOutputStream dos)
- {
- base.Marshal(dos);
- if (dos != null)
- {
- try
- {
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Unmarshal(DataInputStream dis)
- {
- base.Unmarshal(dis);
-
- if (dis != null)
- {
- try
- {
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- base.Reflection(sb);
- try
- {
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as EntityInformationFamilyPdu;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(EntityInformationFamilyPdu obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- ivarsEqual = base.Equals(obj);
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ base.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/EntityManagementFamilyPdu.cs b/tests/OpenDisNet.Reference/Generated/EntityManagementFamilyPdu.cs
deleted file mode 100644
index b7473c8..0000000
--- a/tests/OpenDisNet.Reference/Generated/EntityManagementFamilyPdu.cs
+++ /dev/null
@@ -1,248 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Managment of grouping of PDUs, and more. Section 7.8
- ///
- [Serializable]
- [XmlRoot]
- public partial class EntityManagementFamilyPdu : Pdu, IEquatable
- {
- ///
- /// Initializes a new instance of the class.
- ///
- public EntityManagementFamilyPdu()
- {
- ProtocolFamily = (byte)7;
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(EntityManagementFamilyPdu left, EntityManagementFamilyPdu right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(EntityManagementFamilyPdu left, EntityManagementFamilyPdu right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public override int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize = base.GetMarshalledSize();
- return marshalSize;
- }
-
- ///
- /// Automatically sets the length of the marshalled data, then calls the marshal method.
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- public virtual void MarshalAutoLengthSet(DataOutputStream dos)
- {
- // Set the length prior to marshalling data
- this.Length = (ushort)this.GetMarshalledSize();
- this.Marshal(dos);
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Marshal(DataOutputStream dos)
- {
- base.Marshal(dos);
- if (dos != null)
- {
- try
- {
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Unmarshal(DataInputStream dis)
- {
- base.Unmarshal(dis);
-
- if (dis != null)
- {
- try
- {
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- base.Reflection(sb);
- try
- {
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as EntityManagementFamilyPdu;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(EntityManagementFamilyPdu obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- ivarsEqual = base.Equals(obj);
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ base.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/EntityMarking.cs b/tests/OpenDisNet.Reference/Generated/EntityMarking.cs
deleted file mode 100644
index daa8304..0000000
--- a/tests/OpenDisNet.Reference/Generated/EntityMarking.cs
+++ /dev/null
@@ -1,335 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Specifies the character set used inthe first byte, followed by 11 characters of text data. Section 6.29
- ///
- [Serializable]
- [XmlRoot]
- public partial class EntityMarking
- {
- ///
- /// The character set
- ///
- private byte _characterSet;
-
- ///
- /// The characters
- ///
- private byte[] _characters = new byte[11];
-
- ///
- /// Initializes a new instance of the class.
- ///
- public EntityMarking()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(EntityMarking left, EntityMarking right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(EntityMarking left, EntityMarking right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += 1; // this._characterSet
- marshalSize += 11 * 1; // _characters
- return marshalSize;
- }
-
- ///
- /// Gets or sets the The character set
- ///
- [XmlElement(Type = typeof(byte), ElementName = "characterSet")]
- public byte CharacterSet
- {
- get
- {
- return this._characterSet;
- }
-
- set
- {
- this._characterSet = value;
- }
- }
-
- ///
- /// Gets or sets the The characters
- ///
- [XmlArray(ElementName = "characters")]
- public byte[] Characters
- {
- get
- {
- return this._characters;
- }
-
- set
- {
- this._characters = value;
- }
-}
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedByte((byte)this._characterSet);
-
- for (int idx = 0; idx < this._characters.Length; idx++)
- {
- dos.WriteByte(this._characters[idx]);
- }
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._characterSet = dis.ReadUnsignedByte();
- for (int idx = 0; idx < this._characters.Length; idx++)
- {
- this._characters[idx] = dis.ReadByte();
- }
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("" + this._characterSet.ToString(CultureInfo.InvariantCulture) + "");
- for (int idx = 0; idx < this._characters.Length; idx++)
- {
- sb.AppendLine("" + this._characters[idx] + "");
- }
-
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as EntityMarking;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(EntityMarking obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (this._characterSet != obj._characterSet)
- {
- ivarsEqual = false;
- }
-
- if (obj._characters.Length != 11)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < 11; idx++)
- {
- if (this._characters[idx] != obj._characters[idx])
- {
- ivarsEqual = false;
- }
- }
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._characterSet.GetHashCode();
-
- for (int idx = 0; idx < 11; idx++)
- {
- result = GenerateHash(result) ^ this._characters[idx].GetHashCode();
- }
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/EntityStatePdu.cs b/tests/OpenDisNet.Reference/Generated/EntityStatePdu.cs
deleted file mode 100644
index e98b77d..0000000
--- a/tests/OpenDisNet.Reference/Generated/EntityStatePdu.cs
+++ /dev/null
@@ -1,721 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Represents the postion and state of one entity in the world. Section 7.2.2. COMPLETE
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(EntityID))]
- [XmlInclude(typeof(EntityType))]
- [XmlInclude(typeof(Vector3Float))]
- [XmlInclude(typeof(Vector3Double))]
- [XmlInclude(typeof(EulerAngles))]
- [XmlInclude(typeof(DeadReckoningParameters))]
- [XmlInclude(typeof(EntityMarking))]
- [XmlInclude(typeof(VariableParameter))]
- public partial class EntityStatePdu : EntityInformationFamilyPdu, IEquatable
- {
- ///
- /// Unique ID for an entity that is tied to this state information
- ///
- private EntityID _entityID = new EntityID();
-
- ///
- /// What force this entity is affiliated with, eg red, blue, neutral, etc
- ///
- private byte _forceId;
-
- ///
- /// How many variable parameters are in the variable length list. In earlier versions of DIS these were known as articulation parameters
- ///
- private byte _numberOfVariableParameters;
-
- ///
- /// Describes the type of entity in the world
- ///
- private EntityType _entityType = new EntityType();
-
- private EntityType _alternativeEntityType = new EntityType();
-
- ///
- /// Describes the speed of the entity in the world
- ///
- private Vector3Float _entityLinearVelocity = new Vector3Float();
-
- ///
- /// describes the location of the entity in the world
- ///
- private Vector3Double _entityLocation = new Vector3Double();
-
- ///
- /// describes the orientation of the entity, in euler angles
- ///
- private EulerAngles _entityOrientation = new EulerAngles();
-
- ///
- /// a series of bit flags that are used to help draw the entity, such as smoking, on fire, etc.
- ///
- private uint _entityAppearance;
-
- ///
- /// parameters used for dead reckoning
- ///
- private DeadReckoningParameters _deadReckoningParameters = new DeadReckoningParameters();
-
- ///
- /// characters that can be used for debugging, or to draw unique strings on the side of entities in the world
- ///
- private EntityMarking _marking = new EntityMarking();
-
- ///
- /// a series of bit flags
- ///
- private uint _capabilities;
-
- ///
- /// variable length list of variable parameters. In earlier DIS versions this was articulation parameters.
- ///
- private List _variableParameters = new List();
-
- ///
- /// Initializes a new instance of the class.
- ///
- public EntityStatePdu()
- {
- PduType = (byte)1;
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(EntityStatePdu left, EntityStatePdu right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(EntityStatePdu left, EntityStatePdu right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public override int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize = base.GetMarshalledSize();
- marshalSize += this._entityID.GetMarshalledSize(); // this._entityID
- marshalSize += 1; // this._forceId
- marshalSize += 1; // this._numberOfVariableParameters
- marshalSize += this._entityType.GetMarshalledSize(); // this._entityType
- marshalSize += this._alternativeEntityType.GetMarshalledSize(); // this._alternativeEntityType
- marshalSize += this._entityLinearVelocity.GetMarshalledSize(); // this._entityLinearVelocity
- marshalSize += this._entityLocation.GetMarshalledSize(); // this._entityLocation
- marshalSize += this._entityOrientation.GetMarshalledSize(); // this._entityOrientation
- marshalSize += 4; // this._entityAppearance
- marshalSize += this._deadReckoningParameters.GetMarshalledSize(); // this._deadReckoningParameters
- marshalSize += this._marking.GetMarshalledSize(); // this._marking
- marshalSize += 4; // this._capabilities
- for (int idx = 0; idx < this._variableParameters.Count; idx++)
- {
- VariableParameter listElement = (VariableParameter)this._variableParameters[idx];
- marshalSize += listElement.GetMarshalledSize();
- }
-
- return marshalSize;
- }
-
- ///
- /// Gets or sets the Unique ID for an entity that is tied to this state information
- ///
- [XmlElement(Type = typeof(EntityID), ElementName = "entityID")]
- public EntityID EntityID
- {
- get
- {
- return this._entityID;
- }
-
- set
- {
- this._entityID = value;
- }
- }
-
- ///
- /// Gets or sets the What force this entity is affiliated with, eg red, blue, neutral, etc
- ///
- [XmlElement(Type = typeof(byte), ElementName = "forceId")]
- public byte ForceId
- {
- get
- {
- return this._forceId;
- }
-
- set
- {
- this._forceId = value;
- }
- }
-
- ///
- /// Note that setting this value will not change the marshalled value. The list whose length this describes is used for that purpose.
- /// The getnumberOfVariableParameters method will also be based on the actual list length rather than this value.
- /// The method is simply here for completeness and should not be used for any computations.
- ///
- [XmlElement(Type = typeof(byte), ElementName = "numberOfVariableParameters")]
- public byte NumberOfVariableParameters
- {
- get
- {
- return this._numberOfVariableParameters;
- }
-
- set
- {
- this._numberOfVariableParameters = value;
- }
- }
-
- ///
- /// Gets or sets the Describes the type of entity in the world
- ///
- [XmlElement(Type = typeof(EntityType), ElementName = "entityType")]
- public EntityType EntityType
- {
- get
- {
- return this._entityType;
- }
-
- set
- {
- this._entityType = value;
- }
- }
-
- [XmlElement(Type = typeof(EntityType), ElementName = "alternativeEntityType")]
- public EntityType AlternativeEntityType
- {
- get
- {
- return this._alternativeEntityType;
- }
-
- set
- {
- this._alternativeEntityType = value;
- }
- }
-
- ///
- /// Gets or sets the Describes the speed of the entity in the world
- ///
- [XmlElement(Type = typeof(Vector3Float), ElementName = "entityLinearVelocity")]
- public Vector3Float EntityLinearVelocity
- {
- get
- {
- return this._entityLinearVelocity;
- }
-
- set
- {
- this._entityLinearVelocity = value;
- }
- }
-
- ///
- /// Gets or sets the describes the location of the entity in the world
- ///
- [XmlElement(Type = typeof(Vector3Double), ElementName = "entityLocation")]
- public Vector3Double EntityLocation
- {
- get
- {
- return this._entityLocation;
- }
-
- set
- {
- this._entityLocation = value;
- }
- }
-
- ///
- /// Gets or sets the describes the orientation of the entity, in euler angles
- ///
- [XmlElement(Type = typeof(EulerAngles), ElementName = "entityOrientation")]
- public EulerAngles EntityOrientation
- {
- get
- {
- return this._entityOrientation;
- }
-
- set
- {
- this._entityOrientation = value;
- }
- }
-
- ///
- /// Gets or sets the a series of bit flags that are used to help draw the entity, such as smoking, on fire, etc.
- ///
- [XmlElement(Type = typeof(uint), ElementName = "entityAppearance")]
- public uint EntityAppearance
- {
- get
- {
- return this._entityAppearance;
- }
-
- set
- {
- this._entityAppearance = value;
- }
- }
-
- ///
- /// Gets or sets the parameters used for dead reckoning
- ///
- [XmlElement(Type = typeof(DeadReckoningParameters), ElementName = "deadReckoningParameters")]
- public DeadReckoningParameters DeadReckoningParameters
- {
- get
- {
- return this._deadReckoningParameters;
- }
-
- set
- {
- this._deadReckoningParameters = value;
- }
- }
-
- ///
- /// Gets or sets the characters that can be used for debugging, or to draw unique strings on the side of entities in the world
- ///
- [XmlElement(Type = typeof(EntityMarking), ElementName = "marking")]
- public EntityMarking Marking
- {
- get
- {
- return this._marking;
- }
-
- set
- {
- this._marking = value;
- }
- }
-
- ///
- /// Gets or sets the a series of bit flags
- ///
- [XmlElement(Type = typeof(uint), ElementName = "capabilities")]
- public uint Capabilities
- {
- get
- {
- return this._capabilities;
- }
-
- set
- {
- this._capabilities = value;
- }
- }
-
- ///
- /// Gets or sets the variable length list of variable parameters. In earlier DIS versions this was articulation parameters.
- ///
- [XmlElement(ElementName = "variableParametersList", Type = typeof(List))]
- public List VariableParameters
- {
- get
- {
- return this._variableParameters;
- }
- }
-
- ///
- /// Automatically sets the length of the marshalled data, then calls the marshal method.
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- public override void MarshalAutoLengthSet(DataOutputStream dos)
- {
- // Set the length prior to marshalling data
- this.Length = (ushort)this.GetMarshalledSize();
- this.Marshal(dos);
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Marshal(DataOutputStream dos)
- {
- base.Marshal(dos);
- if (dos != null)
- {
- try
- {
- this._entityID.Marshal(dos);
- dos.WriteUnsignedByte((byte)this._forceId);
- dos.WriteUnsignedByte((byte)this._variableParameters.Count);
- this._entityType.Marshal(dos);
- this._alternativeEntityType.Marshal(dos);
- this._entityLinearVelocity.Marshal(dos);
- this._entityLocation.Marshal(dos);
- this._entityOrientation.Marshal(dos);
- dos.WriteUnsignedInt((uint)this._entityAppearance);
- this._deadReckoningParameters.Marshal(dos);
- this._marking.Marshal(dos);
- dos.WriteUnsignedInt((uint)this._capabilities);
-
- for (int idx = 0; idx < this._variableParameters.Count; idx++)
- {
- VariableParameter aVariableParameter = (VariableParameter)this._variableParameters[idx];
- aVariableParameter.Marshal(dos);
- }
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Unmarshal(DataInputStream dis)
- {
- base.Unmarshal(dis);
-
- if (dis != null)
- {
- try
- {
- this._entityID.Unmarshal(dis);
- this._forceId = dis.ReadUnsignedByte();
- this._numberOfVariableParameters = dis.ReadUnsignedByte();
- this._entityType.Unmarshal(dis);
- this._alternativeEntityType.Unmarshal(dis);
- this._entityLinearVelocity.Unmarshal(dis);
- this._entityLocation.Unmarshal(dis);
- this._entityOrientation.Unmarshal(dis);
- this._entityAppearance = dis.ReadUnsignedInt();
- this._deadReckoningParameters.Unmarshal(dis);
- this._marking.Unmarshal(dis);
- this._capabilities = dis.ReadUnsignedInt();
- for (int idx = 0; idx < this.NumberOfVariableParameters; idx++)
- {
- VariableParameter anX = new VariableParameter();
- anX.Unmarshal(dis);
- this._variableParameters.Add(anX);
- };
-
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- base.Reflection(sb);
- try
- {
- sb.AppendLine("");
- this._entityID.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._forceId.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._variableParameters.Count.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- this._entityType.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- this._alternativeEntityType.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- this._entityLinearVelocity.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- this._entityLocation.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- this._entityOrientation.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._entityAppearance.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- this._deadReckoningParameters.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- this._marking.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._capabilities.ToString(CultureInfo.InvariantCulture) + "");
- for (int idx = 0; idx < this._variableParameters.Count; idx++)
- {
- sb.AppendLine("");
- VariableParameter aVariableParameter = (VariableParameter)this._variableParameters[idx];
- aVariableParameter.Reflection(sb);
- sb.AppendLine("");
- }
-
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as EntityStatePdu;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(EntityStatePdu obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- ivarsEqual = base.Equals(obj);
-
- if (!this._entityID.Equals(obj._entityID))
- {
- ivarsEqual = false;
- }
-
- if (this._forceId != obj._forceId)
- {
- ivarsEqual = false;
- }
-
- if (this._numberOfVariableParameters != obj._numberOfVariableParameters)
- {
- ivarsEqual = false;
- }
-
- if (!this._entityType.Equals(obj._entityType))
- {
- ivarsEqual = false;
- }
-
- if (!this._alternativeEntityType.Equals(obj._alternativeEntityType))
- {
- ivarsEqual = false;
- }
-
- if (!this._entityLinearVelocity.Equals(obj._entityLinearVelocity))
- {
- ivarsEqual = false;
- }
-
- if (!this._entityLocation.Equals(obj._entityLocation))
- {
- ivarsEqual = false;
- }
-
- if (!this._entityOrientation.Equals(obj._entityOrientation))
- {
- ivarsEqual = false;
- }
-
- if (this._entityAppearance != obj._entityAppearance)
- {
- ivarsEqual = false;
- }
-
- if (!this._deadReckoningParameters.Equals(obj._deadReckoningParameters))
- {
- ivarsEqual = false;
- }
-
- if (!this._marking.Equals(obj._marking))
- {
- ivarsEqual = false;
- }
-
- if (this._capabilities != obj._capabilities)
- {
- ivarsEqual = false;
- }
-
- if (this._variableParameters.Count != obj._variableParameters.Count)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < this._variableParameters.Count; idx++)
- {
- if (!this._variableParameters[idx].Equals(obj._variableParameters[idx]))
- {
- ivarsEqual = false;
- }
- }
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ base.GetHashCode();
-
- result = GenerateHash(result) ^ this._entityID.GetHashCode();
- result = GenerateHash(result) ^ this._forceId.GetHashCode();
- result = GenerateHash(result) ^ this._numberOfVariableParameters.GetHashCode();
- result = GenerateHash(result) ^ this._entityType.GetHashCode();
- result = GenerateHash(result) ^ this._alternativeEntityType.GetHashCode();
- result = GenerateHash(result) ^ this._entityLinearVelocity.GetHashCode();
- result = GenerateHash(result) ^ this._entityLocation.GetHashCode();
- result = GenerateHash(result) ^ this._entityOrientation.GetHashCode();
- result = GenerateHash(result) ^ this._entityAppearance.GetHashCode();
- result = GenerateHash(result) ^ this._deadReckoningParameters.GetHashCode();
- result = GenerateHash(result) ^ this._marking.GetHashCode();
- result = GenerateHash(result) ^ this._capabilities.GetHashCode();
-
- if (this._variableParameters.Count > 0)
- {
- for (int idx = 0; idx < this._variableParameters.Count; idx++)
- {
- result = GenerateHash(result) ^ this._variableParameters[idx].GetHashCode();
- }
- }
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/EntityStateUpdatePdu.cs b/tests/OpenDisNet.Reference/Generated/EntityStateUpdatePdu.cs
deleted file mode 100644
index 5d4e53d..0000000
--- a/tests/OpenDisNet.Reference/Generated/EntityStateUpdatePdu.cs
+++ /dev/null
@@ -1,557 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Nonstatic information about a particular entity may be communicated by issuing an Entity State Update PDU. Section 7.2.5. COMPLETE
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(EntityID))]
- [XmlInclude(typeof(Vector3Float))]
- [XmlInclude(typeof(Vector3Double))]
- [XmlInclude(typeof(EulerAngles))]
- [XmlInclude(typeof(VariableParameter))]
- public partial class EntityStateUpdatePdu : EntityInformationFamilyPdu, IEquatable
- {
- ///
- /// This field shall identify the entity issuing the PDU, and shall be represented by an Entity Identifier record (see 6.2.28).
- ///
- private EntityID _entityID = new EntityID();
-
- ///
- /// Padding
- ///
- private byte _padding1;
-
- ///
- /// This field shall specify the number of variable parameters present. This field shall be represented by an 8-bit unsigned integer (see Annex I).
- ///
- private byte _numberOfVariableParameters;
-
- ///
- /// This field shall specify an entity’s linear velocity. The coordinate system for an entity’s linear velocity depends on the dead reckoning algorithm used. This field shall be represented by a Linear Velocity Vector record [see 6.2.95 item c)]).
- ///
- private Vector3Float _entityLinearVelocity = new Vector3Float();
-
- ///
- /// This field shall specify an entity’s physical location in the simulated world and shall be represented by a World Coordinates record (see 6.2.97).
- ///
- private Vector3Double _entityLocation = new Vector3Double();
-
- ///
- /// This field shall specify an entity’s orientation and shall be represented by an Euler Angles record (see 6.2.33).
- ///
- private EulerAngles _entityOrientation = new EulerAngles();
-
- ///
- /// This field shall specify the dynamic changes to the entity’s appearance attributes. This field shall be represented by an Entity Appearance record (see 6.2.26).
- ///
- private uint _entityAppearance;
-
- ///
- /// This field shall specify the parameter values for each Variable Parameter record that is included (see 6.2.93 and Annex I).
- ///
- private List _variableParameters = new List();
-
- ///
- /// Initializes a new instance of the class.
- ///
- public EntityStateUpdatePdu()
- {
- PduType = (byte)67;
- ProtocolFamily = (byte)1;
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(EntityStateUpdatePdu left, EntityStateUpdatePdu right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(EntityStateUpdatePdu left, EntityStateUpdatePdu right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public override int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize = base.GetMarshalledSize();
- marshalSize += this._entityID.GetMarshalledSize(); // this._entityID
- marshalSize += 1; // this._padding1
- marshalSize += 1; // this._numberOfVariableParameters
- marshalSize += this._entityLinearVelocity.GetMarshalledSize(); // this._entityLinearVelocity
- marshalSize += this._entityLocation.GetMarshalledSize(); // this._entityLocation
- marshalSize += this._entityOrientation.GetMarshalledSize(); // this._entityOrientation
- marshalSize += 4; // this._entityAppearance
- for (int idx = 0; idx < this._variableParameters.Count; idx++)
- {
- VariableParameter listElement = (VariableParameter)this._variableParameters[idx];
- marshalSize += listElement.GetMarshalledSize();
- }
-
- return marshalSize;
- }
-
- ///
- /// Gets or sets the This field shall identify the entity issuing the PDU, and shall be represented by an Entity Identifier record (see 6.2.28).
- ///
- [XmlElement(Type = typeof(EntityID), ElementName = "entityID")]
- public EntityID EntityID
- {
- get
- {
- return this._entityID;
- }
-
- set
- {
- this._entityID = value;
- }
- }
-
- ///
- /// Gets or sets the Padding
- ///
- [XmlElement(Type = typeof(byte), ElementName = "padding1")]
- public byte Padding1
- {
- get
- {
- return this._padding1;
- }
-
- set
- {
- this._padding1 = value;
- }
- }
-
- ///
- /// Note that setting this value will not change the marshalled value. The list whose length this describes is used for that purpose.
- /// The getnumberOfVariableParameters method will also be based on the actual list length rather than this value.
- /// The method is simply here for completeness and should not be used for any computations.
- ///
- [XmlElement(Type = typeof(byte), ElementName = "numberOfVariableParameters")]
- public byte NumberOfVariableParameters
- {
- get
- {
- return this._numberOfVariableParameters;
- }
-
- set
- {
- this._numberOfVariableParameters = value;
- }
- }
-
- ///
- /// Gets or sets the This field shall specify an entity’s linear velocity. The coordinate system for an entity’s linear velocity depends on the dead reckoning algorithm used. This field shall be represented by a Linear Velocity Vector record [see 6.2.95 item c)]).
- ///
- [XmlElement(Type = typeof(Vector3Float), ElementName = "entityLinearVelocity")]
- public Vector3Float EntityLinearVelocity
- {
- get
- {
- return this._entityLinearVelocity;
- }
-
- set
- {
- this._entityLinearVelocity = value;
- }
- }
-
- ///
- /// Gets or sets the This field shall specify an entity’s physical location in the simulated world and shall be represented by a World Coordinates record (see 6.2.97).
- ///
- [XmlElement(Type = typeof(Vector3Double), ElementName = "entityLocation")]
- public Vector3Double EntityLocation
- {
- get
- {
- return this._entityLocation;
- }
-
- set
- {
- this._entityLocation = value;
- }
- }
-
- ///
- /// Gets or sets the This field shall specify an entity’s orientation and shall be represented by an Euler Angles record (see 6.2.33).
- ///
- [XmlElement(Type = typeof(EulerAngles), ElementName = "entityOrientation")]
- public EulerAngles EntityOrientation
- {
- get
- {
- return this._entityOrientation;
- }
-
- set
- {
- this._entityOrientation = value;
- }
- }
-
- ///
- /// Gets or sets the This field shall specify the dynamic changes to the entity’s appearance attributes. This field shall be represented by an Entity Appearance record (see 6.2.26).
- ///
- [XmlElement(Type = typeof(uint), ElementName = "entityAppearance")]
- public uint EntityAppearance
- {
- get
- {
- return this._entityAppearance;
- }
-
- set
- {
- this._entityAppearance = value;
- }
- }
-
- ///
- /// Gets or sets the This field shall specify the parameter values for each Variable Parameter record that is included (see 6.2.93 and Annex I).
- ///
- [XmlElement(ElementName = "variableParametersList", Type = typeof(List))]
- public List VariableParameters
- {
- get
- {
- return this._variableParameters;
- }
- }
-
- ///
- /// Automatically sets the length of the marshalled data, then calls the marshal method.
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- public override void MarshalAutoLengthSet(DataOutputStream dos)
- {
- // Set the length prior to marshalling data
- this.Length = (ushort)this.GetMarshalledSize();
- this.Marshal(dos);
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Marshal(DataOutputStream dos)
- {
- base.Marshal(dos);
- if (dos != null)
- {
- try
- {
- this._entityID.Marshal(dos);
- dos.WriteByte((byte)this._padding1);
- dos.WriteUnsignedByte((byte)this._variableParameters.Count);
- this._entityLinearVelocity.Marshal(dos);
- this._entityLocation.Marshal(dos);
- this._entityOrientation.Marshal(dos);
- dos.WriteUnsignedInt((uint)this._entityAppearance);
-
- for (int idx = 0; idx < this._variableParameters.Count; idx++)
- {
- VariableParameter aVariableParameter = (VariableParameter)this._variableParameters[idx];
- aVariableParameter.Marshal(dos);
- }
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Unmarshal(DataInputStream dis)
- {
- base.Unmarshal(dis);
-
- if (dis != null)
- {
- try
- {
- this._entityID.Unmarshal(dis);
- this._padding1 = dis.ReadByte();
- this._numberOfVariableParameters = dis.ReadUnsignedByte();
- this._entityLinearVelocity.Unmarshal(dis);
- this._entityLocation.Unmarshal(dis);
- this._entityOrientation.Unmarshal(dis);
- this._entityAppearance = dis.ReadUnsignedInt();
- for (int idx = 0; idx < this.NumberOfVariableParameters; idx++)
- {
- VariableParameter anX = new VariableParameter();
- anX.Unmarshal(dis);
- this._variableParameters.Add(anX);
- };
-
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- base.Reflection(sb);
- try
- {
- sb.AppendLine("");
- this._entityID.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._padding1.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._variableParameters.Count.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- this._entityLinearVelocity.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- this._entityLocation.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- this._entityOrientation.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._entityAppearance.ToString(CultureInfo.InvariantCulture) + "");
- for (int idx = 0; idx < this._variableParameters.Count; idx++)
- {
- sb.AppendLine("");
- VariableParameter aVariableParameter = (VariableParameter)this._variableParameters[idx];
- aVariableParameter.Reflection(sb);
- sb.AppendLine("");
- }
-
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as EntityStateUpdatePdu;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(EntityStateUpdatePdu obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- ivarsEqual = base.Equals(obj);
-
- if (!this._entityID.Equals(obj._entityID))
- {
- ivarsEqual = false;
- }
-
- if (this._padding1 != obj._padding1)
- {
- ivarsEqual = false;
- }
-
- if (this._numberOfVariableParameters != obj._numberOfVariableParameters)
- {
- ivarsEqual = false;
- }
-
- if (!this._entityLinearVelocity.Equals(obj._entityLinearVelocity))
- {
- ivarsEqual = false;
- }
-
- if (!this._entityLocation.Equals(obj._entityLocation))
- {
- ivarsEqual = false;
- }
-
- if (!this._entityOrientation.Equals(obj._entityOrientation))
- {
- ivarsEqual = false;
- }
-
- if (this._entityAppearance != obj._entityAppearance)
- {
- ivarsEqual = false;
- }
-
- if (this._variableParameters.Count != obj._variableParameters.Count)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < this._variableParameters.Count; idx++)
- {
- if (!this._variableParameters[idx].Equals(obj._variableParameters[idx]))
- {
- ivarsEqual = false;
- }
- }
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ base.GetHashCode();
-
- result = GenerateHash(result) ^ this._entityID.GetHashCode();
- result = GenerateHash(result) ^ this._padding1.GetHashCode();
- result = GenerateHash(result) ^ this._numberOfVariableParameters.GetHashCode();
- result = GenerateHash(result) ^ this._entityLinearVelocity.GetHashCode();
- result = GenerateHash(result) ^ this._entityLocation.GetHashCode();
- result = GenerateHash(result) ^ this._entityOrientation.GetHashCode();
- result = GenerateHash(result) ^ this._entityAppearance.GetHashCode();
-
- if (this._variableParameters.Count > 0)
- {
- for (int idx = 0; idx < this._variableParameters.Count; idx++)
- {
- result = GenerateHash(result) ^ this._variableParameters[idx].GetHashCode();
- }
- }
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/EntityType.cs b/tests/OpenDisNet.Reference/Generated/EntityType.cs
deleted file mode 100644
index b47ca07..0000000
--- a/tests/OpenDisNet.Reference/Generated/EntityType.cs
+++ /dev/null
@@ -1,463 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Identifies the type of entity, including kind of entity, domain (surface, subsurface, air, etc) country, category, etc. Section 6.2.30
- ///
- [Serializable]
- [XmlRoot]
- public partial class EntityType
- {
- ///
- /// Kind of entity
- ///
- private byte _entityKind;
-
- ///
- /// Domain of entity (air, surface, subsurface, space, etc)
- ///
- private byte _domain;
-
- ///
- /// country to which the design of the entity is attributed
- ///
- private ushort _country;
-
- ///
- /// category of entity
- ///
- private byte _category;
-
- ///
- /// subcategory of entity
- ///
- private byte _subcategory;
-
- ///
- /// specific info based on subcategory field. Renamed from specific because that is a reserved word in SQL.
- ///
- private byte _specific;
-
- private byte _extra;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public EntityType()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(EntityType left, EntityType right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(EntityType left, EntityType right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += 1; // this._entityKind
- marshalSize += 1; // this._domain
- marshalSize += 2; // this._country
- marshalSize += 1; // this._category
- marshalSize += 1; // this._subcategory
- marshalSize += 1; // this._specific
- marshalSize += 1; // this._extra
- return marshalSize;
- }
-
- ///
- /// Gets or sets the Kind of entity
- ///
- [XmlElement(Type = typeof(byte), ElementName = "entityKind")]
- public byte EntityKind
- {
- get
- {
- return this._entityKind;
- }
-
- set
- {
- this._entityKind = value;
- }
- }
-
- ///
- /// Gets or sets the Domain of entity (air, surface, subsurface, space, etc)
- ///
- [XmlElement(Type = typeof(byte), ElementName = "domain")]
- public byte Domain
- {
- get
- {
- return this._domain;
- }
-
- set
- {
- this._domain = value;
- }
- }
-
- ///
- /// Gets or sets the country to which the design of the entity is attributed
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "country")]
- public ushort Country
- {
- get
- {
- return this._country;
- }
-
- set
- {
- this._country = value;
- }
- }
-
- ///
- /// Gets or sets the category of entity
- ///
- [XmlElement(Type = typeof(byte), ElementName = "category")]
- public byte Category
- {
- get
- {
- return this._category;
- }
-
- set
- {
- this._category = value;
- }
- }
-
- ///
- /// Gets or sets the subcategory of entity
- ///
- [XmlElement(Type = typeof(byte), ElementName = "subcategory")]
- public byte Subcategory
- {
- get
- {
- return this._subcategory;
- }
-
- set
- {
- this._subcategory = value;
- }
- }
-
- ///
- /// Gets or sets the specific info based on subcategory field. Renamed from specific because that is a reserved word in SQL.
- ///
- [XmlElement(Type = typeof(byte), ElementName = "specific")]
- public byte Specific
- {
- get
- {
- return this._specific;
- }
-
- set
- {
- this._specific = value;
- }
- }
-
- [XmlElement(Type = typeof(byte), ElementName = "extra")]
- public byte Extra
- {
- get
- {
- return this._extra;
- }
-
- set
- {
- this._extra = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedByte((byte)this._entityKind);
- dos.WriteUnsignedByte((byte)this._domain);
- dos.WriteUnsignedShort((ushort)this._country);
- dos.WriteUnsignedByte((byte)this._category);
- dos.WriteUnsignedByte((byte)this._subcategory);
- dos.WriteUnsignedByte((byte)this._specific);
- dos.WriteUnsignedByte((byte)this._extra);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._entityKind = dis.ReadUnsignedByte();
- this._domain = dis.ReadUnsignedByte();
- this._country = dis.ReadUnsignedShort();
- this._category = dis.ReadUnsignedByte();
- this._subcategory = dis.ReadUnsignedByte();
- this._specific = dis.ReadUnsignedByte();
- this._extra = dis.ReadUnsignedByte();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("" + this._entityKind.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._domain.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._country.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._category.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._subcategory.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._specific.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._extra.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as EntityType;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(EntityType obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (this._entityKind != obj._entityKind)
- {
- ivarsEqual = false;
- }
-
- if (this._domain != obj._domain)
- {
- ivarsEqual = false;
- }
-
- if (this._country != obj._country)
- {
- ivarsEqual = false;
- }
-
- if (this._category != obj._category)
- {
- ivarsEqual = false;
- }
-
- if (this._subcategory != obj._subcategory)
- {
- ivarsEqual = false;
- }
-
- if (this._specific != obj._specific)
- {
- ivarsEqual = false;
- }
-
- if (this._extra != obj._extra)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._entityKind.GetHashCode();
- result = GenerateHash(result) ^ this._domain.GetHashCode();
- result = GenerateHash(result) ^ this._country.GetHashCode();
- result = GenerateHash(result) ^ this._category.GetHashCode();
- result = GenerateHash(result) ^ this._subcategory.GetHashCode();
- result = GenerateHash(result) ^ this._specific.GetHashCode();
- result = GenerateHash(result) ^ this._extra.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/EntityTypeVP.cs b/tests/OpenDisNet.Reference/Generated/EntityTypeVP.cs
deleted file mode 100644
index 7d6b6c8..0000000
--- a/tests/OpenDisNet.Reference/Generated/EntityTypeVP.cs
+++ /dev/null
@@ -1,408 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Association or disassociation of two entities. Section 6.2.93.5
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(EntityType))]
- public partial class EntityTypeVP
- {
- ///
- /// the identification of the Variable Parameter record. Enumeration from EBV
- ///
- private byte _recordType = 3;
-
- ///
- /// Indicates if this VP has changed since last issuance
- ///
- private byte _changeIndicator;
-
- ///
- ///
- ///
- private EntityType _entityType = new EntityType();
-
- ///
- /// padding
- ///
- private ushort _padding;
-
- ///
- /// padding
- ///
- private uint _padding1;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public EntityTypeVP()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(EntityTypeVP left, EntityTypeVP right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(EntityTypeVP left, EntityTypeVP right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += 1; // this._recordType
- marshalSize += 1; // this._changeIndicator
- marshalSize += this._entityType.GetMarshalledSize(); // this._entityType
- marshalSize += 2; // this._padding
- marshalSize += 4; // this._padding1
- return marshalSize;
- }
-
- ///
- /// Gets or sets the the identification of the Variable Parameter record. Enumeration from EBV
- ///
- [XmlElement(Type = typeof(byte), ElementName = "recordType")]
- public byte RecordType
- {
- get
- {
- return this._recordType;
- }
-
- set
- {
- this._recordType = value;
- }
- }
-
- ///
- /// Gets or sets the Indicates if this VP has changed since last issuance
- ///
- [XmlElement(Type = typeof(byte), ElementName = "changeIndicator")]
- public byte ChangeIndicator
- {
- get
- {
- return this._changeIndicator;
- }
-
- set
- {
- this._changeIndicator = value;
- }
- }
-
- ///
- /// Gets or sets the
- ///
- [XmlElement(Type = typeof(EntityType), ElementName = "entityType")]
- public EntityType EntityType
- {
- get
- {
- return this._entityType;
- }
-
- set
- {
- this._entityType = value;
- }
- }
-
- ///
- /// Gets or sets the padding
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "padding")]
- public ushort Padding
- {
- get
- {
- return this._padding;
- }
-
- set
- {
- this._padding = value;
- }
- }
-
- ///
- /// Gets or sets the padding
- ///
- [XmlElement(Type = typeof(uint), ElementName = "padding1")]
- public uint Padding1
- {
- get
- {
- return this._padding1;
- }
-
- set
- {
- this._padding1 = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedByte((byte)this._recordType);
- dos.WriteUnsignedByte((byte)this._changeIndicator);
- this._entityType.Marshal(dos);
- dos.WriteUnsignedShort((ushort)this._padding);
- dos.WriteUnsignedInt((uint)this._padding1);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._recordType = dis.ReadUnsignedByte();
- this._changeIndicator = dis.ReadUnsignedByte();
- this._entityType.Unmarshal(dis);
- this._padding = dis.ReadUnsignedShort();
- this._padding1 = dis.ReadUnsignedInt();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("" + this._recordType.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._changeIndicator.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- this._entityType.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._padding.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._padding1.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as EntityTypeVP;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(EntityTypeVP obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (this._recordType != obj._recordType)
- {
- ivarsEqual = false;
- }
-
- if (this._changeIndicator != obj._changeIndicator)
- {
- ivarsEqual = false;
- }
-
- if (!this._entityType.Equals(obj._entityType))
- {
- ivarsEqual = false;
- }
-
- if (this._padding != obj._padding)
- {
- ivarsEqual = false;
- }
-
- if (this._padding1 != obj._padding1)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._recordType.GetHashCode();
- result = GenerateHash(result) ^ this._changeIndicator.GetHashCode();
- result = GenerateHash(result) ^ this._entityType.GetHashCode();
- result = GenerateHash(result) ^ this._padding.GetHashCode();
- result = GenerateHash(result) ^ this._padding1.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/Environment.cs b/tests/OpenDisNet.Reference/Generated/Environment.cs
deleted file mode 100644
index 1e12306..0000000
--- a/tests/OpenDisNet.Reference/Generated/Environment.cs
+++ /dev/null
@@ -1,373 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Incomplete environment record; requires hand coding to fix. Section 6.2.31.1
- ///
- [Serializable]
- [XmlRoot]
- public partial class Environment
- {
- ///
- /// type
- ///
- private uint _environmentType;
-
- ///
- /// length, in bits, of the record
- ///
- private ushort _length;
-
- ///
- /// identifies the sequntially numbered record index
- ///
- private byte _index;
-
- ///
- /// padding
- ///
- private byte _padding;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public Environment()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(Environment left, Environment right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(Environment left, Environment right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += 4; // this._environmentType
- marshalSize += 2; // this._length
- marshalSize += 1; // this._index
- marshalSize += 1; // this._padding
- return marshalSize;
- }
-
- ///
- /// Gets or sets the type
- ///
- [XmlElement(Type = typeof(uint), ElementName = "environmentType")]
- public uint EnvironmentType
- {
- get
- {
- return this._environmentType;
- }
-
- set
- {
- this._environmentType = value;
- }
- }
-
- ///
- /// Gets or sets the length, in bits, of the record
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "length")]
- public ushort Length
- {
- get
- {
- return this._length;
- }
-
- set
- {
- this._length = value;
- }
- }
-
- ///
- /// Gets or sets the identifies the sequntially numbered record index
- ///
- [XmlElement(Type = typeof(byte), ElementName = "index")]
- public byte Index
- {
- get
- {
- return this._index;
- }
-
- set
- {
- this._index = value;
- }
- }
-
- ///
- /// Gets or sets the padding
- ///
- [XmlElement(Type = typeof(byte), ElementName = "padding")]
- public byte Padding
- {
- get
- {
- return this._padding;
- }
-
- set
- {
- this._padding = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedInt((uint)this._environmentType);
- dos.WriteUnsignedShort((ushort)this._length);
- dos.WriteUnsignedByte((byte)this._index);
- dos.WriteUnsignedByte((byte)this._padding);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._environmentType = dis.ReadUnsignedInt();
- this._length = dis.ReadUnsignedShort();
- this._index = dis.ReadUnsignedByte();
- this._padding = dis.ReadUnsignedByte();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("" + this._environmentType.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._length.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._index.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._padding.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as Environment;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(Environment obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (this._environmentType != obj._environmentType)
- {
- ivarsEqual = false;
- }
-
- if (this._length != obj._length)
- {
- ivarsEqual = false;
- }
-
- if (this._index != obj._index)
- {
- ivarsEqual = false;
- }
-
- if (this._padding != obj._padding)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._environmentType.GetHashCode();
- result = GenerateHash(result) ^ this._length.GetHashCode();
- result = GenerateHash(result) ^ this._index.GetHashCode();
- result = GenerateHash(result) ^ this._padding.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/EnvironmentGeneral.cs b/tests/OpenDisNet.Reference/Generated/EnvironmentGeneral.cs
deleted file mode 100644
index 1724b06..0000000
--- a/tests/OpenDisNet.Reference/Generated/EnvironmentGeneral.cs
+++ /dev/null
@@ -1,437 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Information about a geometry, a state associated with a geometry, a bounding volume, or an associated entity ID. NOTE: this class requires hand coding. 6.2.31
- ///
- [Serializable]
- [XmlRoot]
- public partial class EnvironmentGeneral
- {
- ///
- /// Record type
- ///
- private uint _environmentType;
-
- ///
- /// length, in bits
- ///
- private byte _length;
-
- ///
- /// Identify the sequentially numbered record index
- ///
- private byte _index;
-
- ///
- /// padding
- ///
- private byte _padding1;
-
- ///
- /// Geometry or state record
- ///
- private byte _geometry;
-
- ///
- /// padding to bring the total size up to a 64 bit boundry
- ///
- private byte _padding2;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public EnvironmentGeneral()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(EnvironmentGeneral left, EnvironmentGeneral right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(EnvironmentGeneral left, EnvironmentGeneral right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += 4; // this._environmentType
- marshalSize += 1; // this._length
- marshalSize += 1; // this._index
- marshalSize += 1; // this._padding1
- marshalSize += 1; // this._geometry
- marshalSize += 1; // this._padding2
- return marshalSize;
- }
-
- ///
- /// Gets or sets the Record type
- ///
- [XmlElement(Type = typeof(uint), ElementName = "environmentType")]
- public uint EnvironmentType
- {
- get
- {
- return this._environmentType;
- }
-
- set
- {
- this._environmentType = value;
- }
- }
-
- ///
- /// Gets or sets the length, in bits
- ///
- [XmlElement(Type = typeof(byte), ElementName = "length")]
- public byte Length
- {
- get
- {
- return this._length;
- }
-
- set
- {
- this._length = value;
- }
- }
-
- ///
- /// Gets or sets the Identify the sequentially numbered record index
- ///
- [XmlElement(Type = typeof(byte), ElementName = "index")]
- public byte Index
- {
- get
- {
- return this._index;
- }
-
- set
- {
- this._index = value;
- }
- }
-
- ///
- /// Gets or sets the padding
- ///
- [XmlElement(Type = typeof(byte), ElementName = "padding1")]
- public byte Padding1
- {
- get
- {
- return this._padding1;
- }
-
- set
- {
- this._padding1 = value;
- }
- }
-
- ///
- /// Gets or sets the Geometry or state record
- ///
- [XmlElement(Type = typeof(byte), ElementName = "geometry")]
- public byte Geometry
- {
- get
- {
- return this._geometry;
- }
-
- set
- {
- this._geometry = value;
- }
- }
-
- ///
- /// Gets or sets the padding to bring the total size up to a 64 bit boundry
- ///
- [XmlElement(Type = typeof(byte), ElementName = "padding2")]
- public byte Padding2
- {
- get
- {
- return this._padding2;
- }
-
- set
- {
- this._padding2 = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedInt((uint)this._environmentType);
- dos.WriteUnsignedByte((byte)this._length);
- dos.WriteUnsignedByte((byte)this._index);
- dos.WriteUnsignedByte((byte)this._padding1);
- dos.WriteUnsignedByte((byte)this._geometry);
- dos.WriteUnsignedByte((byte)this._padding2);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._environmentType = dis.ReadUnsignedInt();
- this._length = dis.ReadUnsignedByte();
- this._index = dis.ReadUnsignedByte();
- this._padding1 = dis.ReadUnsignedByte();
- this._geometry = dis.ReadUnsignedByte();
- this._padding2 = dis.ReadUnsignedByte();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("" + this._environmentType.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._length.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._index.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._padding1.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._geometry.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._padding2.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as EnvironmentGeneral;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(EnvironmentGeneral obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (this._environmentType != obj._environmentType)
- {
- ivarsEqual = false;
- }
-
- if (this._length != obj._length)
- {
- ivarsEqual = false;
- }
-
- if (this._index != obj._index)
- {
- ivarsEqual = false;
- }
-
- if (this._padding1 != obj._padding1)
- {
- ivarsEqual = false;
- }
-
- if (this._geometry != obj._geometry)
- {
- ivarsEqual = false;
- }
-
- if (this._padding2 != obj._padding2)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._environmentType.GetHashCode();
- result = GenerateHash(result) ^ this._length.GetHashCode();
- result = GenerateHash(result) ^ this._index.GetHashCode();
- result = GenerateHash(result) ^ this._padding1.GetHashCode();
- result = GenerateHash(result) ^ this._geometry.GetHashCode();
- result = GenerateHash(result) ^ this._padding2.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/EnvironmentType.cs b/tests/OpenDisNet.Reference/Generated/EnvironmentType.cs
deleted file mode 100644
index 94072fb..0000000
--- a/tests/OpenDisNet.Reference/Generated/EnvironmentType.cs
+++ /dev/null
@@ -1,463 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Description of environmental data in environmental process and gridded data PDUs. Section 6.2.32
- ///
- [Serializable]
- [XmlRoot]
- public partial class EnvironmentType
- {
- ///
- /// Kind of entity
- ///
- private byte _entityKind;
-
- ///
- /// Domain of entity (air, surface, subsurface, space, etc)
- ///
- private byte _domain;
-
- ///
- /// class of environmental entity
- ///
- private ushort _entityClass;
-
- ///
- /// category of entity
- ///
- private byte _category;
-
- ///
- /// subcategory of entity
- ///
- private byte _subcategory;
-
- ///
- /// specific info based on subcategory field
- ///
- private byte _specific;
-
- private byte _extra;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public EnvironmentType()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(EnvironmentType left, EnvironmentType right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(EnvironmentType left, EnvironmentType right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += 1; // this._entityKind
- marshalSize += 1; // this._domain
- marshalSize += 2; // this._entityClass
- marshalSize += 1; // this._category
- marshalSize += 1; // this._subcategory
- marshalSize += 1; // this._specific
- marshalSize += 1; // this._extra
- return marshalSize;
- }
-
- ///
- /// Gets or sets the Kind of entity
- ///
- [XmlElement(Type = typeof(byte), ElementName = "entityKind")]
- public byte EntityKind
- {
- get
- {
- return this._entityKind;
- }
-
- set
- {
- this._entityKind = value;
- }
- }
-
- ///
- /// Gets or sets the Domain of entity (air, surface, subsurface, space, etc)
- ///
- [XmlElement(Type = typeof(byte), ElementName = "domain")]
- public byte Domain
- {
- get
- {
- return this._domain;
- }
-
- set
- {
- this._domain = value;
- }
- }
-
- ///
- /// Gets or sets the class of environmental entity
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "entityClass")]
- public ushort EntityClass
- {
- get
- {
- return this._entityClass;
- }
-
- set
- {
- this._entityClass = value;
- }
- }
-
- ///
- /// Gets or sets the category of entity
- ///
- [XmlElement(Type = typeof(byte), ElementName = "category")]
- public byte Category
- {
- get
- {
- return this._category;
- }
-
- set
- {
- this._category = value;
- }
- }
-
- ///
- /// Gets or sets the subcategory of entity
- ///
- [XmlElement(Type = typeof(byte), ElementName = "subcategory")]
- public byte Subcategory
- {
- get
- {
- return this._subcategory;
- }
-
- set
- {
- this._subcategory = value;
- }
- }
-
- ///
- /// Gets or sets the specific info based on subcategory field
- ///
- [XmlElement(Type = typeof(byte), ElementName = "specific")]
- public byte Specific
- {
- get
- {
- return this._specific;
- }
-
- set
- {
- this._specific = value;
- }
- }
-
- [XmlElement(Type = typeof(byte), ElementName = "extra")]
- public byte Extra
- {
- get
- {
- return this._extra;
- }
-
- set
- {
- this._extra = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedByte((byte)this._entityKind);
- dos.WriteUnsignedByte((byte)this._domain);
- dos.WriteUnsignedShort((ushort)this._entityClass);
- dos.WriteUnsignedByte((byte)this._category);
- dos.WriteUnsignedByte((byte)this._subcategory);
- dos.WriteUnsignedByte((byte)this._specific);
- dos.WriteUnsignedByte((byte)this._extra);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._entityKind = dis.ReadUnsignedByte();
- this._domain = dis.ReadUnsignedByte();
- this._entityClass = dis.ReadUnsignedShort();
- this._category = dis.ReadUnsignedByte();
- this._subcategory = dis.ReadUnsignedByte();
- this._specific = dis.ReadUnsignedByte();
- this._extra = dis.ReadUnsignedByte();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("" + this._entityKind.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._domain.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._entityClass.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._category.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._subcategory.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._specific.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._extra.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as EnvironmentType;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(EnvironmentType obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (this._entityKind != obj._entityKind)
- {
- ivarsEqual = false;
- }
-
- if (this._domain != obj._domain)
- {
- ivarsEqual = false;
- }
-
- if (this._entityClass != obj._entityClass)
- {
- ivarsEqual = false;
- }
-
- if (this._category != obj._category)
- {
- ivarsEqual = false;
- }
-
- if (this._subcategory != obj._subcategory)
- {
- ivarsEqual = false;
- }
-
- if (this._specific != obj._specific)
- {
- ivarsEqual = false;
- }
-
- if (this._extra != obj._extra)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._entityKind.GetHashCode();
- result = GenerateHash(result) ^ this._domain.GetHashCode();
- result = GenerateHash(result) ^ this._entityClass.GetHashCode();
- result = GenerateHash(result) ^ this._category.GetHashCode();
- result = GenerateHash(result) ^ this._subcategory.GetHashCode();
- result = GenerateHash(result) ^ this._specific.GetHashCode();
- result = GenerateHash(result) ^ this._extra.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/EulerAngles.cs b/tests/OpenDisNet.Reference/Generated/EulerAngles.cs
deleted file mode 100644
index 16d7243..0000000
--- a/tests/OpenDisNet.Reference/Generated/EulerAngles.cs
+++ /dev/null
@@ -1,323 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Three floating point values representing an orientation, psi, theta, and phi, aka the euler angles, in radians. Section 6.2.33
- ///
- [Serializable]
- [XmlRoot]
- public partial class EulerAngles
- {
- private float _psi;
-
- private float _theta;
-
- private float _phi;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public EulerAngles()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(EulerAngles left, EulerAngles right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(EulerAngles left, EulerAngles right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += 4; // this._psi
- marshalSize += 4; // this._theta
- marshalSize += 4; // this._phi
- return marshalSize;
- }
-
- [XmlElement(Type = typeof(float), ElementName = "psi")]
- public float Psi
- {
- get
- {
- return this._psi;
- }
-
- set
- {
- this._psi = value;
- }
- }
-
- [XmlElement(Type = typeof(float), ElementName = "theta")]
- public float Theta
- {
- get
- {
- return this._theta;
- }
-
- set
- {
- this._theta = value;
- }
- }
-
- [XmlElement(Type = typeof(float), ElementName = "phi")]
- public float Phi
- {
- get
- {
- return this._phi;
- }
-
- set
- {
- this._phi = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- dos.WriteFloat((float)this._psi);
- dos.WriteFloat((float)this._theta);
- dos.WriteFloat((float)this._phi);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._psi = dis.ReadFloat();
- this._theta = dis.ReadFloat();
- this._phi = dis.ReadFloat();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("" + this._psi.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._theta.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._phi.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as EulerAngles;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(EulerAngles obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (this._psi != obj._psi)
- {
- ivarsEqual = false;
- }
-
- if (this._theta != obj._theta)
- {
- ivarsEqual = false;
- }
-
- if (this._phi != obj._phi)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._psi.GetHashCode();
- result = GenerateHash(result) ^ this._theta.GetHashCode();
- result = GenerateHash(result) ^ this._phi.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/EventIdentifier.cs b/tests/OpenDisNet.Reference/Generated/EventIdentifier.cs
deleted file mode 100644
index 7be27fa..0000000
--- a/tests/OpenDisNet.Reference/Generated/EventIdentifier.cs
+++ /dev/null
@@ -1,306 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Identifies an event in the world. Use this format for every PDU EXCEPT the LiveEntityPdu. Section 6.2.34.
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(SimulationAddress))]
- public partial class EventIdentifier
- {
- ///
- /// Site and application IDs
- ///
- private SimulationAddress _simulationAddress = new SimulationAddress();
-
- private ushort _eventNumber;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public EventIdentifier()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(EventIdentifier left, EventIdentifier right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(EventIdentifier left, EventIdentifier right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += this._simulationAddress.GetMarshalledSize(); // this._simulationAddress
- marshalSize += 2; // this._eventNumber
- return marshalSize;
- }
-
- ///
- /// Gets or sets the Site and application IDs
- ///
- [XmlElement(Type = typeof(SimulationAddress), ElementName = "simulationAddress")]
- public SimulationAddress SimulationAddress
- {
- get
- {
- return this._simulationAddress;
- }
-
- set
- {
- this._simulationAddress = value;
- }
- }
-
- [XmlElement(Type = typeof(ushort), ElementName = "eventNumber")]
- public ushort EventNumber
- {
- get
- {
- return this._eventNumber;
- }
-
- set
- {
- this._eventNumber = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- this._simulationAddress.Marshal(dos);
- dos.WriteUnsignedShort((ushort)this._eventNumber);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._simulationAddress.Unmarshal(dis);
- this._eventNumber = dis.ReadUnsignedShort();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("");
- this._simulationAddress.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._eventNumber.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as EventIdentifier;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(EventIdentifier obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (!this._simulationAddress.Equals(obj._simulationAddress))
- {
- ivarsEqual = false;
- }
-
- if (this._eventNumber != obj._eventNumber)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._simulationAddress.GetHashCode();
- result = GenerateHash(result) ^ this._eventNumber.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/EventIdentifierLiveEntity.cs b/tests/OpenDisNet.Reference/Generated/EventIdentifierLiveEntity.cs
deleted file mode 100644
index 7d9bf3e..0000000
--- a/tests/OpenDisNet.Reference/Generated/EventIdentifierLiveEntity.cs
+++ /dev/null
@@ -1,323 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Identifies an event in the world. Use this format for ONLY the LiveEntityPdu. Section 6.2.34.
- ///
- [Serializable]
- [XmlRoot]
- public partial class EventIdentifierLiveEntity
- {
- private byte _siteNumber;
-
- private byte _applicationNumber;
-
- private ushort _eventNumber;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public EventIdentifierLiveEntity()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(EventIdentifierLiveEntity left, EventIdentifierLiveEntity right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(EventIdentifierLiveEntity left, EventIdentifierLiveEntity right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += 1; // this._siteNumber
- marshalSize += 1; // this._applicationNumber
- marshalSize += 2; // this._eventNumber
- return marshalSize;
- }
-
- [XmlElement(Type = typeof(byte), ElementName = "siteNumber")]
- public byte SiteNumber
- {
- get
- {
- return this._siteNumber;
- }
-
- set
- {
- this._siteNumber = value;
- }
- }
-
- [XmlElement(Type = typeof(byte), ElementName = "applicationNumber")]
- public byte ApplicationNumber
- {
- get
- {
- return this._applicationNumber;
- }
-
- set
- {
- this._applicationNumber = value;
- }
- }
-
- [XmlElement(Type = typeof(ushort), ElementName = "eventNumber")]
- public ushort EventNumber
- {
- get
- {
- return this._eventNumber;
- }
-
- set
- {
- this._eventNumber = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedByte((byte)this._siteNumber);
- dos.WriteUnsignedByte((byte)this._applicationNumber);
- dos.WriteUnsignedShort((ushort)this._eventNumber);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._siteNumber = dis.ReadUnsignedByte();
- this._applicationNumber = dis.ReadUnsignedByte();
- this._eventNumber = dis.ReadUnsignedShort();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("" + this._siteNumber.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._applicationNumber.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._eventNumber.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as EventIdentifierLiveEntity;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(EventIdentifierLiveEntity obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (this._siteNumber != obj._siteNumber)
- {
- ivarsEqual = false;
- }
-
- if (this._applicationNumber != obj._applicationNumber)
- {
- ivarsEqual = false;
- }
-
- if (this._eventNumber != obj._eventNumber)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._siteNumber.GetHashCode();
- result = GenerateHash(result) ^ this._applicationNumber.GetHashCode();
- result = GenerateHash(result) ^ this._eventNumber.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/EventReportPdu.cs b/tests/OpenDisNet.Reference/Generated/EventReportPdu.cs
deleted file mode 100644
index 84d3bfa..0000000
--- a/tests/OpenDisNet.Reference/Generated/EventReportPdu.cs
+++ /dev/null
@@ -1,519 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Reports occurance of a significant event to the simulation manager. Section 7.5.12. COMPLETE
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(FixedDatum))]
- [XmlInclude(typeof(VariableDatum))]
- public partial class EventReportPdu : SimulationManagementFamilyPdu, IEquatable
- {
- ///
- /// Type of event
- ///
- private uint _eventType;
-
- ///
- /// padding
- ///
- private uint _padding1;
-
- ///
- /// Number of fixed datum records
- ///
- private uint _numberOfFixedDatumRecords;
-
- ///
- /// Number of variable datum records
- ///
- private uint _numberOfVariableDatumRecords;
-
- ///
- /// variable length list of fixed datums
- ///
- private List _fixedDatums = new List();
-
- ///
- /// variable length list of variable length datums
- ///
- private List _variableDatums = new List();
-
- ///
- /// Initializes a new instance of the class.
- ///
- public EventReportPdu()
- {
- PduType = (byte)21;
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(EventReportPdu left, EventReportPdu right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(EventReportPdu left, EventReportPdu right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public override int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize = base.GetMarshalledSize();
- marshalSize += 4; // this._eventType
- marshalSize += 4; // this._padding1
- marshalSize += 4; // this._numberOfFixedDatumRecords
- marshalSize += 4; // this._numberOfVariableDatumRecords
- for (int idx = 0; idx < this._fixedDatums.Count; idx++)
- {
- FixedDatum listElement = (FixedDatum)this._fixedDatums[idx];
- marshalSize += listElement.GetMarshalledSize();
- }
-
- for (int idx = 0; idx < this._variableDatums.Count; idx++)
- {
- VariableDatum listElement = (VariableDatum)this._variableDatums[idx];
- marshalSize += listElement.GetMarshalledSize();
- }
-
- return marshalSize;
- }
-
- ///
- /// Gets or sets the Type of event
- ///
- [XmlElement(Type = typeof(uint), ElementName = "eventType")]
- public uint EventType
- {
- get
- {
- return this._eventType;
- }
-
- set
- {
- this._eventType = value;
- }
- }
-
- ///
- /// Gets or sets the padding
- ///
- [XmlElement(Type = typeof(uint), ElementName = "padding1")]
- public uint Padding1
- {
- get
- {
- return this._padding1;
- }
-
- set
- {
- this._padding1 = value;
- }
- }
-
- ///
- /// Note that setting this value will not change the marshalled value. The list whose length this describes is used for that purpose.
- /// The getnumberOfFixedDatumRecords method will also be based on the actual list length rather than this value.
- /// The method is simply here for completeness and should not be used for any computations.
- ///
- [XmlElement(Type = typeof(uint), ElementName = "numberOfFixedDatumRecords")]
- public uint NumberOfFixedDatumRecords
- {
- get
- {
- return this._numberOfFixedDatumRecords;
- }
-
- set
- {
- this._numberOfFixedDatumRecords = value;
- }
- }
-
- ///
- /// Note that setting this value will not change the marshalled value. The list whose length this describes is used for that purpose.
- /// The getnumberOfVariableDatumRecords method will also be based on the actual list length rather than this value.
- /// The method is simply here for completeness and should not be used for any computations.
- ///
- [XmlElement(Type = typeof(uint), ElementName = "numberOfVariableDatumRecords")]
- public uint NumberOfVariableDatumRecords
- {
- get
- {
- return this._numberOfVariableDatumRecords;
- }
-
- set
- {
- this._numberOfVariableDatumRecords = value;
- }
- }
-
- ///
- /// Gets or sets the variable length list of fixed datums
- ///
- [XmlElement(ElementName = "fixedDatumsList", Type = typeof(List))]
- public List FixedDatums
- {
- get
- {
- return this._fixedDatums;
- }
- }
-
- ///
- /// Gets or sets the variable length list of variable length datums
- ///
- [XmlElement(ElementName = "variableDatumsList", Type = typeof(List))]
- public List VariableDatums
- {
- get
- {
- return this._variableDatums;
- }
- }
-
- ///
- /// Automatically sets the length of the marshalled data, then calls the marshal method.
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- public override void MarshalAutoLengthSet(DataOutputStream dos)
- {
- // Set the length prior to marshalling data
- this.Length = (ushort)this.GetMarshalledSize();
- this.Marshal(dos);
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Marshal(DataOutputStream dos)
- {
- base.Marshal(dos);
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedInt((uint)this._eventType);
- dos.WriteUnsignedInt((uint)this._padding1);
- dos.WriteUnsignedInt((uint)this._fixedDatums.Count);
- dos.WriteUnsignedInt((uint)this._variableDatums.Count);
-
- for (int idx = 0; idx < this._fixedDatums.Count; idx++)
- {
- FixedDatum aFixedDatum = (FixedDatum)this._fixedDatums[idx];
- aFixedDatum.Marshal(dos);
- }
-
- for (int idx = 0; idx < this._variableDatums.Count; idx++)
- {
- VariableDatum aVariableDatum = (VariableDatum)this._variableDatums[idx];
- aVariableDatum.Marshal(dos);
- }
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Unmarshal(DataInputStream dis)
- {
- base.Unmarshal(dis);
-
- if (dis != null)
- {
- try
- {
- this._eventType = dis.ReadUnsignedInt();
- this._padding1 = dis.ReadUnsignedInt();
- this._numberOfFixedDatumRecords = dis.ReadUnsignedInt();
- this._numberOfVariableDatumRecords = dis.ReadUnsignedInt();
- for (int idx = 0; idx < this.NumberOfFixedDatumRecords; idx++)
- {
- FixedDatum anX = new FixedDatum();
- anX.Unmarshal(dis);
- this._fixedDatums.Add(anX);
- };
-
- for (int idx = 0; idx < this.NumberOfVariableDatumRecords; idx++)
- {
- VariableDatum anX = new VariableDatum();
- anX.Unmarshal(dis);
- this._variableDatums.Add(anX);
- };
-
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- base.Reflection(sb);
- try
- {
- sb.AppendLine("" + this._eventType.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._padding1.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._fixedDatums.Count.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._variableDatums.Count.ToString(CultureInfo.InvariantCulture) + "");
- for (int idx = 0; idx < this._fixedDatums.Count; idx++)
- {
- sb.AppendLine("");
- FixedDatum aFixedDatum = (FixedDatum)this._fixedDatums[idx];
- aFixedDatum.Reflection(sb);
- sb.AppendLine("");
- }
-
- for (int idx = 0; idx < this._variableDatums.Count; idx++)
- {
- sb.AppendLine("");
- VariableDatum aVariableDatum = (VariableDatum)this._variableDatums[idx];
- aVariableDatum.Reflection(sb);
- sb.AppendLine("");
- }
-
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as EventReportPdu;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(EventReportPdu obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- ivarsEqual = base.Equals(obj);
-
- if (this._eventType != obj._eventType)
- {
- ivarsEqual = false;
- }
-
- if (this._padding1 != obj._padding1)
- {
- ivarsEqual = false;
- }
-
- if (this._numberOfFixedDatumRecords != obj._numberOfFixedDatumRecords)
- {
- ivarsEqual = false;
- }
-
- if (this._numberOfVariableDatumRecords != obj._numberOfVariableDatumRecords)
- {
- ivarsEqual = false;
- }
-
- if (this._fixedDatums.Count != obj._fixedDatums.Count)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < this._fixedDatums.Count; idx++)
- {
- if (!this._fixedDatums[idx].Equals(obj._fixedDatums[idx]))
- {
- ivarsEqual = false;
- }
- }
- }
-
- if (this._variableDatums.Count != obj._variableDatums.Count)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < this._variableDatums.Count; idx++)
- {
- if (!this._variableDatums[idx].Equals(obj._variableDatums[idx]))
- {
- ivarsEqual = false;
- }
- }
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ base.GetHashCode();
-
- result = GenerateHash(result) ^ this._eventType.GetHashCode();
- result = GenerateHash(result) ^ this._padding1.GetHashCode();
- result = GenerateHash(result) ^ this._numberOfFixedDatumRecords.GetHashCode();
- result = GenerateHash(result) ^ this._numberOfVariableDatumRecords.GetHashCode();
-
- if (this._fixedDatums.Count > 0)
- {
- for (int idx = 0; idx < this._fixedDatums.Count; idx++)
- {
- result = GenerateHash(result) ^ this._fixedDatums[idx].GetHashCode();
- }
- }
-
- if (this._variableDatums.Count > 0)
- {
- for (int idx = 0; idx < this._variableDatums.Count; idx++)
- {
- result = GenerateHash(result) ^ this._variableDatums[idx].GetHashCode();
- }
- }
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/EventReportReliablePdu.cs b/tests/OpenDisNet.Reference/Generated/EventReportReliablePdu.cs
deleted file mode 100644
index a2c1d50..0000000
--- a/tests/OpenDisNet.Reference/Generated/EventReportReliablePdu.cs
+++ /dev/null
@@ -1,519 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Section 5.3.12.11: reports the occurance of a significatnt event to the simulation manager. Needs manual intervention to fix padding in variable datums. UNFINISHED.
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(FixedDatum))]
- [XmlInclude(typeof(VariableDatum))]
- public partial class EventReportReliablePdu : SimulationManagementWithReliabilityFamilyPdu, IEquatable
- {
- ///
- /// Event type
- ///
- private ushort _eventType;
-
- ///
- /// padding
- ///
- private uint _pad1;
-
- ///
- /// Fixed datum record count
- ///
- private uint _numberOfFixedDatumRecords;
-
- ///
- /// variable datum record count
- ///
- private uint _numberOfVariableDatumRecords;
-
- ///
- /// Fixed datum records
- ///
- private List _fixedDatumRecords = new List();
-
- ///
- /// Variable datum records
- ///
- private List _variableDatumRecords = new List();
-
- ///
- /// Initializes a new instance of the class.
- ///
- public EventReportReliablePdu()
- {
- PduType = (byte)61;
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(EventReportReliablePdu left, EventReportReliablePdu right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(EventReportReliablePdu left, EventReportReliablePdu right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public override int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize = base.GetMarshalledSize();
- marshalSize += 2; // this._eventType
- marshalSize += 4; // this._pad1
- marshalSize += 4; // this._numberOfFixedDatumRecords
- marshalSize += 4; // this._numberOfVariableDatumRecords
- for (int idx = 0; idx < this._fixedDatumRecords.Count; idx++)
- {
- FixedDatum listElement = (FixedDatum)this._fixedDatumRecords[idx];
- marshalSize += listElement.GetMarshalledSize();
- }
-
- for (int idx = 0; idx < this._variableDatumRecords.Count; idx++)
- {
- VariableDatum listElement = (VariableDatum)this._variableDatumRecords[idx];
- marshalSize += listElement.GetMarshalledSize();
- }
-
- return marshalSize;
- }
-
- ///
- /// Gets or sets the Event type
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "eventType")]
- public ushort EventType
- {
- get
- {
- return this._eventType;
- }
-
- set
- {
- this._eventType = value;
- }
- }
-
- ///
- /// Gets or sets the padding
- ///
- [XmlElement(Type = typeof(uint), ElementName = "pad1")]
- public uint Pad1
- {
- get
- {
- return this._pad1;
- }
-
- set
- {
- this._pad1 = value;
- }
- }
-
- ///
- /// Note that setting this value will not change the marshalled value. The list whose length this describes is used for that purpose.
- /// The getnumberOfFixedDatumRecords method will also be based on the actual list length rather than this value.
- /// The method is simply here for completeness and should not be used for any computations.
- ///
- [XmlElement(Type = typeof(uint), ElementName = "numberOfFixedDatumRecords")]
- public uint NumberOfFixedDatumRecords
- {
- get
- {
- return this._numberOfFixedDatumRecords;
- }
-
- set
- {
- this._numberOfFixedDatumRecords = value;
- }
- }
-
- ///
- /// Note that setting this value will not change the marshalled value. The list whose length this describes is used for that purpose.
- /// The getnumberOfVariableDatumRecords method will also be based on the actual list length rather than this value.
- /// The method is simply here for completeness and should not be used for any computations.
- ///
- [XmlElement(Type = typeof(uint), ElementName = "numberOfVariableDatumRecords")]
- public uint NumberOfVariableDatumRecords
- {
- get
- {
- return this._numberOfVariableDatumRecords;
- }
-
- set
- {
- this._numberOfVariableDatumRecords = value;
- }
- }
-
- ///
- /// Gets or sets the Fixed datum records
- ///
- [XmlElement(ElementName = "fixedDatumRecordsList", Type = typeof(List))]
- public List FixedDatumRecords
- {
- get
- {
- return this._fixedDatumRecords;
- }
- }
-
- ///
- /// Gets or sets the Variable datum records
- ///
- [XmlElement(ElementName = "variableDatumRecordsList", Type = typeof(List))]
- public List VariableDatumRecords
- {
- get
- {
- return this._variableDatumRecords;
- }
- }
-
- ///
- /// Automatically sets the length of the marshalled data, then calls the marshal method.
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- public override void MarshalAutoLengthSet(DataOutputStream dos)
- {
- // Set the length prior to marshalling data
- this.Length = (ushort)this.GetMarshalledSize();
- this.Marshal(dos);
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Marshal(DataOutputStream dos)
- {
- base.Marshal(dos);
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedShort((ushort)this._eventType);
- dos.WriteUnsignedInt((uint)this._pad1);
- dos.WriteUnsignedInt((uint)this._fixedDatumRecords.Count);
- dos.WriteUnsignedInt((uint)this._variableDatumRecords.Count);
-
- for (int idx = 0; idx < this._fixedDatumRecords.Count; idx++)
- {
- FixedDatum aFixedDatum = (FixedDatum)this._fixedDatumRecords[idx];
- aFixedDatum.Marshal(dos);
- }
-
- for (int idx = 0; idx < this._variableDatumRecords.Count; idx++)
- {
- VariableDatum aVariableDatum = (VariableDatum)this._variableDatumRecords[idx];
- aVariableDatum.Marshal(dos);
- }
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Unmarshal(DataInputStream dis)
- {
- base.Unmarshal(dis);
-
- if (dis != null)
- {
- try
- {
- this._eventType = dis.ReadUnsignedShort();
- this._pad1 = dis.ReadUnsignedInt();
- this._numberOfFixedDatumRecords = dis.ReadUnsignedInt();
- this._numberOfVariableDatumRecords = dis.ReadUnsignedInt();
- for (int idx = 0; idx < this.NumberOfFixedDatumRecords; idx++)
- {
- FixedDatum anX = new FixedDatum();
- anX.Unmarshal(dis);
- this._fixedDatumRecords.Add(anX);
- };
-
- for (int idx = 0; idx < this.NumberOfVariableDatumRecords; idx++)
- {
- VariableDatum anX = new VariableDatum();
- anX.Unmarshal(dis);
- this._variableDatumRecords.Add(anX);
- };
-
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- base.Reflection(sb);
- try
- {
- sb.AppendLine("" + this._eventType.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._pad1.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._fixedDatumRecords.Count.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._variableDatumRecords.Count.ToString(CultureInfo.InvariantCulture) + "");
- for (int idx = 0; idx < this._fixedDatumRecords.Count; idx++)
- {
- sb.AppendLine("");
- FixedDatum aFixedDatum = (FixedDatum)this._fixedDatumRecords[idx];
- aFixedDatum.Reflection(sb);
- sb.AppendLine("");
- }
-
- for (int idx = 0; idx < this._variableDatumRecords.Count; idx++)
- {
- sb.AppendLine("");
- VariableDatum aVariableDatum = (VariableDatum)this._variableDatumRecords[idx];
- aVariableDatum.Reflection(sb);
- sb.AppendLine("");
- }
-
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as EventReportReliablePdu;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(EventReportReliablePdu obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- ivarsEqual = base.Equals(obj);
-
- if (this._eventType != obj._eventType)
- {
- ivarsEqual = false;
- }
-
- if (this._pad1 != obj._pad1)
- {
- ivarsEqual = false;
- }
-
- if (this._numberOfFixedDatumRecords != obj._numberOfFixedDatumRecords)
- {
- ivarsEqual = false;
- }
-
- if (this._numberOfVariableDatumRecords != obj._numberOfVariableDatumRecords)
- {
- ivarsEqual = false;
- }
-
- if (this._fixedDatumRecords.Count != obj._fixedDatumRecords.Count)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < this._fixedDatumRecords.Count; idx++)
- {
- if (!this._fixedDatumRecords[idx].Equals(obj._fixedDatumRecords[idx]))
- {
- ivarsEqual = false;
- }
- }
- }
-
- if (this._variableDatumRecords.Count != obj._variableDatumRecords.Count)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < this._variableDatumRecords.Count; idx++)
- {
- if (!this._variableDatumRecords[idx].Equals(obj._variableDatumRecords[idx]))
- {
- ivarsEqual = false;
- }
- }
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ base.GetHashCode();
-
- result = GenerateHash(result) ^ this._eventType.GetHashCode();
- result = GenerateHash(result) ^ this._pad1.GetHashCode();
- result = GenerateHash(result) ^ this._numberOfFixedDatumRecords.GetHashCode();
- result = GenerateHash(result) ^ this._numberOfVariableDatumRecords.GetHashCode();
-
- if (this._fixedDatumRecords.Count > 0)
- {
- for (int idx = 0; idx < this._fixedDatumRecords.Count; idx++)
- {
- result = GenerateHash(result) ^ this._fixedDatumRecords[idx].GetHashCode();
- }
- }
-
- if (this._variableDatumRecords.Count > 0)
- {
- for (int idx = 0; idx < this._variableDatumRecords.Count; idx++)
- {
- result = GenerateHash(result) ^ this._variableDatumRecords[idx].GetHashCode();
- }
- }
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/Expendable.cs b/tests/OpenDisNet.Reference/Generated/Expendable.cs
deleted file mode 100644
index 7b8aeaa..0000000
--- a/tests/OpenDisNet.Reference/Generated/Expendable.cs
+++ /dev/null
@@ -1,384 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// An entity's expendable (chaff, flares, etc) information. Section 6.2.36
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(EntityType))]
- public partial class Expendable
- {
- ///
- /// Type of expendable
- ///
- private EntityType _expendable = new EntityType();
-
- private uint _station;
-
- private ushort _quantity;
-
- private byte _expendableStatus;
-
- private byte _padding;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public Expendable()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(Expendable left, Expendable right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(Expendable left, Expendable right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += this._expendable.GetMarshalledSize(); // this._expendable
- marshalSize += 4; // this._station
- marshalSize += 2; // this._quantity
- marshalSize += 1; // this._expendableStatus
- marshalSize += 1; // this._padding
- return marshalSize;
- }
-
- ///
- /// Gets or sets the Type of expendable
- ///
- [XmlElement(Type = typeof(EntityType), ElementName = "expendable")]
- public EntityType Expendable_
- {
- get
- {
- return this._expendable;
- }
-
- set
- {
- this._expendable = value;
- }
- }
-
- [XmlElement(Type = typeof(uint), ElementName = "station")]
- public uint Station
- {
- get
- {
- return this._station;
- }
-
- set
- {
- this._station = value;
- }
- }
-
- [XmlElement(Type = typeof(ushort), ElementName = "quantity")]
- public ushort Quantity
- {
- get
- {
- return this._quantity;
- }
-
- set
- {
- this._quantity = value;
- }
- }
-
- [XmlElement(Type = typeof(byte), ElementName = "expendableStatus")]
- public byte ExpendableStatus
- {
- get
- {
- return this._expendableStatus;
- }
-
- set
- {
- this._expendableStatus = value;
- }
- }
-
- [XmlElement(Type = typeof(byte), ElementName = "padding")]
- public byte Padding
- {
- get
- {
- return this._padding;
- }
-
- set
- {
- this._padding = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- this._expendable.Marshal(dos);
- dos.WriteUnsignedInt((uint)this._station);
- dos.WriteUnsignedShort((ushort)this._quantity);
- dos.WriteUnsignedByte((byte)this._expendableStatus);
- dos.WriteUnsignedByte((byte)this._padding);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._expendable.Unmarshal(dis);
- this._station = dis.ReadUnsignedInt();
- this._quantity = dis.ReadUnsignedShort();
- this._expendableStatus = dis.ReadUnsignedByte();
- this._padding = dis.ReadUnsignedByte();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("");
- this._expendable.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._station.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._quantity.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._expendableStatus.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._padding.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as Expendable;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(Expendable obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (!this._expendable.Equals(obj._expendable))
- {
- ivarsEqual = false;
- }
-
- if (this._station != obj._station)
- {
- ivarsEqual = false;
- }
-
- if (this._quantity != obj._quantity)
- {
- ivarsEqual = false;
- }
-
- if (this._expendableStatus != obj._expendableStatus)
- {
- ivarsEqual = false;
- }
-
- if (this._padding != obj._padding)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._expendable.GetHashCode();
- result = GenerateHash(result) ^ this._station.GetHashCode();
- result = GenerateHash(result) ^ this._quantity.GetHashCode();
- result = GenerateHash(result) ^ this._expendableStatus.GetHashCode();
- result = GenerateHash(result) ^ this._padding.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/ExpendableDescriptor.cs b/tests/OpenDisNet.Reference/Generated/ExpendableDescriptor.cs
deleted file mode 100644
index 0949309..0000000
--- a/tests/OpenDisNet.Reference/Generated/ExpendableDescriptor.cs
+++ /dev/null
@@ -1,312 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Burst of chaff or expendible device. Section 6.2.20.4
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(EntityType))]
- public partial class ExpendableDescriptor
- {
- ///
- /// Type of the object that exploded
- ///
- private EntityType _expendableType = new EntityType();
-
- ///
- /// Padding
- ///
- private long _padding;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public ExpendableDescriptor()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(ExpendableDescriptor left, ExpendableDescriptor right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(ExpendableDescriptor left, ExpendableDescriptor right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += this._expendableType.GetMarshalledSize(); // this._expendableType
- marshalSize += 8; // this._padding
- return marshalSize;
- }
-
- ///
- /// Gets or sets the Type of the object that exploded
- ///
- [XmlElement(Type = typeof(EntityType), ElementName = "expendableType")]
- public EntityType ExpendableType
- {
- get
- {
- return this._expendableType;
- }
-
- set
- {
- this._expendableType = value;
- }
- }
-
- ///
- /// Gets or sets the Padding
- ///
- [XmlElement(Type = typeof(long), ElementName = "padding")]
- public long Padding
- {
- get
- {
- return this._padding;
- }
-
- set
- {
- this._padding = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- this._expendableType.Marshal(dos);
- dos.WriteLong((long)this._padding);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._expendableType.Unmarshal(dis);
- this._padding = dis.ReadLong();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("");
- this._expendableType.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._padding.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as ExpendableDescriptor;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(ExpendableDescriptor obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (!this._expendableType.Equals(obj._expendableType))
- {
- ivarsEqual = false;
- }
-
- if (this._padding != obj._padding)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._expendableType.GetHashCode();
- result = GenerateHash(result) ^ this._padding.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/ExpendableReload.cs b/tests/OpenDisNet.Reference/Generated/ExpendableReload.cs
deleted file mode 100644
index 4e12354..0000000
--- a/tests/OpenDisNet.Reference/Generated/ExpendableReload.cs
+++ /dev/null
@@ -1,410 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// An entity's expendable (chaff, flares, etc) information. Section 6.2.37
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(EntityType))]
- public partial class ExpendableReload
- {
- ///
- /// Type of expendable
- ///
- private EntityType _expendable = new EntityType();
-
- private uint _station;
-
- private ushort _standardQuantity;
-
- private ushort _maximumQuantity;
-
- private uint _standardQuantityReloadTime;
-
- private uint _maximumQuantityReloadTime;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public ExpendableReload()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(ExpendableReload left, ExpendableReload right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(ExpendableReload left, ExpendableReload right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += this._expendable.GetMarshalledSize(); // this._expendable
- marshalSize += 4; // this._station
- marshalSize += 2; // this._standardQuantity
- marshalSize += 2; // this._maximumQuantity
- marshalSize += 4; // this._standardQuantityReloadTime
- marshalSize += 4; // this._maximumQuantityReloadTime
- return marshalSize;
- }
-
- ///
- /// Gets or sets the Type of expendable
- ///
- [XmlElement(Type = typeof(EntityType), ElementName = "expendable")]
- public EntityType Expendable
- {
- get
- {
- return this._expendable;
- }
-
- set
- {
- this._expendable = value;
- }
- }
-
- [XmlElement(Type = typeof(uint), ElementName = "station")]
- public uint Station
- {
- get
- {
- return this._station;
- }
-
- set
- {
- this._station = value;
- }
- }
-
- [XmlElement(Type = typeof(ushort), ElementName = "standardQuantity")]
- public ushort StandardQuantity
- {
- get
- {
- return this._standardQuantity;
- }
-
- set
- {
- this._standardQuantity = value;
- }
- }
-
- [XmlElement(Type = typeof(ushort), ElementName = "maximumQuantity")]
- public ushort MaximumQuantity
- {
- get
- {
- return this._maximumQuantity;
- }
-
- set
- {
- this._maximumQuantity = value;
- }
- }
-
- [XmlElement(Type = typeof(uint), ElementName = "standardQuantityReloadTime")]
- public uint StandardQuantityReloadTime
- {
- get
- {
- return this._standardQuantityReloadTime;
- }
-
- set
- {
- this._standardQuantityReloadTime = value;
- }
- }
-
- [XmlElement(Type = typeof(uint), ElementName = "maximumQuantityReloadTime")]
- public uint MaximumQuantityReloadTime
- {
- get
- {
- return this._maximumQuantityReloadTime;
- }
-
- set
- {
- this._maximumQuantityReloadTime = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- this._expendable.Marshal(dos);
- dos.WriteUnsignedInt((uint)this._station);
- dos.WriteUnsignedShort((ushort)this._standardQuantity);
- dos.WriteUnsignedShort((ushort)this._maximumQuantity);
- dos.WriteUnsignedInt((uint)this._standardQuantityReloadTime);
- dos.WriteUnsignedInt((uint)this._maximumQuantityReloadTime);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._expendable.Unmarshal(dis);
- this._station = dis.ReadUnsignedInt();
- this._standardQuantity = dis.ReadUnsignedShort();
- this._maximumQuantity = dis.ReadUnsignedShort();
- this._standardQuantityReloadTime = dis.ReadUnsignedInt();
- this._maximumQuantityReloadTime = dis.ReadUnsignedInt();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("");
- this._expendable.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._station.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._standardQuantity.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._maximumQuantity.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._standardQuantityReloadTime.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._maximumQuantityReloadTime.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as ExpendableReload;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(ExpendableReload obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (!this._expendable.Equals(obj._expendable))
- {
- ivarsEqual = false;
- }
-
- if (this._station != obj._station)
- {
- ivarsEqual = false;
- }
-
- if (this._standardQuantity != obj._standardQuantity)
- {
- ivarsEqual = false;
- }
-
- if (this._maximumQuantity != obj._maximumQuantity)
- {
- ivarsEqual = false;
- }
-
- if (this._standardQuantityReloadTime != obj._standardQuantityReloadTime)
- {
- ivarsEqual = false;
- }
-
- if (this._maximumQuantityReloadTime != obj._maximumQuantityReloadTime)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._expendable.GetHashCode();
- result = GenerateHash(result) ^ this._station.GetHashCode();
- result = GenerateHash(result) ^ this._standardQuantity.GetHashCode();
- result = GenerateHash(result) ^ this._maximumQuantity.GetHashCode();
- result = GenerateHash(result) ^ this._standardQuantityReloadTime.GetHashCode();
- result = GenerateHash(result) ^ this._maximumQuantityReloadTime.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/ExplosionDescriptor.cs b/tests/OpenDisNet.Reference/Generated/ExplosionDescriptor.cs
deleted file mode 100644
index 41e58e6..0000000
--- a/tests/OpenDisNet.Reference/Generated/ExplosionDescriptor.cs
+++ /dev/null
@@ -1,376 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Explosion of a non-munition. Section 6.2.20.3
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(EntityType))]
- public partial class ExplosionDescriptor
- {
- ///
- /// Type of the object that exploded. See 6.2.30
- ///
- private EntityType _explodingObject = new EntityType();
-
- ///
- /// Material that exploded. Can be grain dust, tnt, gasoline, etc.
- ///
- private ushort _explosiveMaterial;
-
- ///
- /// padding
- ///
- private ushort _padding;
-
- ///
- /// Force of explosion, in equivalent KG of TNT
- ///
- private float _explosiveForce;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public ExplosionDescriptor()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(ExplosionDescriptor left, ExplosionDescriptor right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(ExplosionDescriptor left, ExplosionDescriptor right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += this._explodingObject.GetMarshalledSize(); // this._explodingObject
- marshalSize += 2; // this._explosiveMaterial
- marshalSize += 2; // this._padding
- marshalSize += 4; // this._explosiveForce
- return marshalSize;
- }
-
- ///
- /// Gets or sets the Type of the object that exploded. See 6.2.30
- ///
- [XmlElement(Type = typeof(EntityType), ElementName = "explodingObject")]
- public EntityType ExplodingObject
- {
- get
- {
- return this._explodingObject;
- }
-
- set
- {
- this._explodingObject = value;
- }
- }
-
- ///
- /// Gets or sets the Material that exploded. Can be grain dust, tnt, gasoline, etc.
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "explosiveMaterial")]
- public ushort ExplosiveMaterial
- {
- get
- {
- return this._explosiveMaterial;
- }
-
- set
- {
- this._explosiveMaterial = value;
- }
- }
-
- ///
- /// Gets or sets the padding
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "padding")]
- public ushort Padding
- {
- get
- {
- return this._padding;
- }
-
- set
- {
- this._padding = value;
- }
- }
-
- ///
- /// Gets or sets the Force of explosion, in equivalent KG of TNT
- ///
- [XmlElement(Type = typeof(float), ElementName = "explosiveForce")]
- public float ExplosiveForce
- {
- get
- {
- return this._explosiveForce;
- }
-
- set
- {
- this._explosiveForce = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- this._explodingObject.Marshal(dos);
- dos.WriteUnsignedShort((ushort)this._explosiveMaterial);
- dos.WriteUnsignedShort((ushort)this._padding);
- dos.WriteFloat((float)this._explosiveForce);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._explodingObject.Unmarshal(dis);
- this._explosiveMaterial = dis.ReadUnsignedShort();
- this._padding = dis.ReadUnsignedShort();
- this._explosiveForce = dis.ReadFloat();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("");
- this._explodingObject.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._explosiveMaterial.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._padding.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._explosiveForce.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as ExplosionDescriptor;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(ExplosionDescriptor obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (!this._explodingObject.Equals(obj._explodingObject))
- {
- ivarsEqual = false;
- }
-
- if (this._explosiveMaterial != obj._explosiveMaterial)
- {
- ivarsEqual = false;
- }
-
- if (this._padding != obj._padding)
- {
- ivarsEqual = false;
- }
-
- if (this._explosiveForce != obj._explosiveForce)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._explodingObject.GetHashCode();
- result = GenerateHash(result) ^ this._explosiveMaterial.GetHashCode();
- result = GenerateHash(result) ^ this._padding.GetHashCode();
- result = GenerateHash(result) ^ this._explosiveForce.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/FalseTargetsAttribute.cs b/tests/OpenDisNet.Reference/Generated/FalseTargetsAttribute.cs
deleted file mode 100644
index 35534c4..0000000
--- a/tests/OpenDisNet.Reference/Generated/FalseTargetsAttribute.cs
+++ /dev/null
@@ -1,609 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// The False Targets attribute record shall be used to communicate discrete values that are associated with false targets jamming that cannot be referenced to an emitter mode. The values provided in the False Targets attri- bute record shall be considered valid only for the victim radar beams listed in the jamming beam's Track/Jam Data records (provided in the associated Electromagnetic Emission PDU). Section 6.2.12.3
- ///
- [Serializable]
- [XmlRoot]
- public partial class FalseTargetsAttribute
- {
- private uint _recordType = 3502;
-
- private ushort _recordLength = 40;
-
- private ushort _padding;
-
- private byte _emitterNumber;
-
- private byte _beamNumber;
-
- private byte _stateIndicator;
-
- private byte _padding2;
-
- private float _falseTargetCount;
-
- private float _walkSpeed;
-
- private float _walkAcceleration;
-
- private float _maximumWalkDistance;
-
- private float _keepTime;
-
- private float _echoSpacing;
-
- private uint _padding3;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public FalseTargetsAttribute()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(FalseTargetsAttribute left, FalseTargetsAttribute right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(FalseTargetsAttribute left, FalseTargetsAttribute right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += 4; // this._recordType
- marshalSize += 2; // this._recordLength
- marshalSize += 2; // this._padding
- marshalSize += 1; // this._emitterNumber
- marshalSize += 1; // this._beamNumber
- marshalSize += 1; // this._stateIndicator
- marshalSize += 1; // this._padding2
- marshalSize += 4; // this._falseTargetCount
- marshalSize += 4; // this._walkSpeed
- marshalSize += 4; // this._walkAcceleration
- marshalSize += 4; // this._maximumWalkDistance
- marshalSize += 4; // this._keepTime
- marshalSize += 4; // this._echoSpacing
- marshalSize += 4; // this._padding3
- return marshalSize;
- }
-
- [XmlElement(Type = typeof(uint), ElementName = "recordType")]
- public uint RecordType
- {
- get
- {
- return this._recordType;
- }
-
- set
- {
- this._recordType = value;
- }
- }
-
- [XmlElement(Type = typeof(ushort), ElementName = "recordLength")]
- public ushort RecordLength
- {
- get
- {
- return this._recordLength;
- }
-
- set
- {
- this._recordLength = value;
- }
- }
-
- [XmlElement(Type = typeof(ushort), ElementName = "padding")]
- public ushort Padding
- {
- get
- {
- return this._padding;
- }
-
- set
- {
- this._padding = value;
- }
- }
-
- [XmlElement(Type = typeof(byte), ElementName = "emitterNumber")]
- public byte EmitterNumber
- {
- get
- {
- return this._emitterNumber;
- }
-
- set
- {
- this._emitterNumber = value;
- }
- }
-
- [XmlElement(Type = typeof(byte), ElementName = "beamNumber")]
- public byte BeamNumber
- {
- get
- {
- return this._beamNumber;
- }
-
- set
- {
- this._beamNumber = value;
- }
- }
-
- [XmlElement(Type = typeof(byte), ElementName = "stateIndicator")]
- public byte StateIndicator
- {
- get
- {
- return this._stateIndicator;
- }
-
- set
- {
- this._stateIndicator = value;
- }
- }
-
- [XmlElement(Type = typeof(byte), ElementName = "padding2")]
- public byte Padding2
- {
- get
- {
- return this._padding2;
- }
-
- set
- {
- this._padding2 = value;
- }
- }
-
- [XmlElement(Type = typeof(float), ElementName = "falseTargetCount")]
- public float FalseTargetCount
- {
- get
- {
- return this._falseTargetCount;
- }
-
- set
- {
- this._falseTargetCount = value;
- }
- }
-
- [XmlElement(Type = typeof(float), ElementName = "walkSpeed")]
- public float WalkSpeed
- {
- get
- {
- return this._walkSpeed;
- }
-
- set
- {
- this._walkSpeed = value;
- }
- }
-
- [XmlElement(Type = typeof(float), ElementName = "walkAcceleration")]
- public float WalkAcceleration
- {
- get
- {
- return this._walkAcceleration;
- }
-
- set
- {
- this._walkAcceleration = value;
- }
- }
-
- [XmlElement(Type = typeof(float), ElementName = "maximumWalkDistance")]
- public float MaximumWalkDistance
- {
- get
- {
- return this._maximumWalkDistance;
- }
-
- set
- {
- this._maximumWalkDistance = value;
- }
- }
-
- [XmlElement(Type = typeof(float), ElementName = "keepTime")]
- public float KeepTime
- {
- get
- {
- return this._keepTime;
- }
-
- set
- {
- this._keepTime = value;
- }
- }
-
- [XmlElement(Type = typeof(float), ElementName = "echoSpacing")]
- public float EchoSpacing
- {
- get
- {
- return this._echoSpacing;
- }
-
- set
- {
- this._echoSpacing = value;
- }
- }
-
- [XmlElement(Type = typeof(uint), ElementName = "padding3")]
- public uint Padding3
- {
- get
- {
- return this._padding3;
- }
-
- set
- {
- this._padding3 = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedInt((uint)this._recordType);
- dos.WriteUnsignedShort((ushort)this._recordLength);
- dos.WriteUnsignedShort((ushort)this._padding);
- dos.WriteUnsignedByte((byte)this._emitterNumber);
- dos.WriteUnsignedByte((byte)this._beamNumber);
- dos.WriteUnsignedByte((byte)this._stateIndicator);
- dos.WriteUnsignedByte((byte)this._padding2);
- dos.WriteFloat((float)this._falseTargetCount);
- dos.WriteFloat((float)this._walkSpeed);
- dos.WriteFloat((float)this._walkAcceleration);
- dos.WriteFloat((float)this._maximumWalkDistance);
- dos.WriteFloat((float)this._keepTime);
- dos.WriteFloat((float)this._echoSpacing);
- dos.WriteUnsignedInt((uint)this._padding3);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._recordType = dis.ReadUnsignedInt();
- this._recordLength = dis.ReadUnsignedShort();
- this._padding = dis.ReadUnsignedShort();
- this._emitterNumber = dis.ReadUnsignedByte();
- this._beamNumber = dis.ReadUnsignedByte();
- this._stateIndicator = dis.ReadUnsignedByte();
- this._padding2 = dis.ReadUnsignedByte();
- this._falseTargetCount = dis.ReadFloat();
- this._walkSpeed = dis.ReadFloat();
- this._walkAcceleration = dis.ReadFloat();
- this._maximumWalkDistance = dis.ReadFloat();
- this._keepTime = dis.ReadFloat();
- this._echoSpacing = dis.ReadFloat();
- this._padding3 = dis.ReadUnsignedInt();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("" + this._recordType.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._recordLength.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._padding.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._emitterNumber.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._beamNumber.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._stateIndicator.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._padding2.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._falseTargetCount.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._walkSpeed.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._walkAcceleration.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._maximumWalkDistance.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._keepTime.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._echoSpacing.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._padding3.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as FalseTargetsAttribute;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(FalseTargetsAttribute obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (this._recordType != obj._recordType)
- {
- ivarsEqual = false;
- }
-
- if (this._recordLength != obj._recordLength)
- {
- ivarsEqual = false;
- }
-
- if (this._padding != obj._padding)
- {
- ivarsEqual = false;
- }
-
- if (this._emitterNumber != obj._emitterNumber)
- {
- ivarsEqual = false;
- }
-
- if (this._beamNumber != obj._beamNumber)
- {
- ivarsEqual = false;
- }
-
- if (this._stateIndicator != obj._stateIndicator)
- {
- ivarsEqual = false;
- }
-
- if (this._padding2 != obj._padding2)
- {
- ivarsEqual = false;
- }
-
- if (this._falseTargetCount != obj._falseTargetCount)
- {
- ivarsEqual = false;
- }
-
- if (this._walkSpeed != obj._walkSpeed)
- {
- ivarsEqual = false;
- }
-
- if (this._walkAcceleration != obj._walkAcceleration)
- {
- ivarsEqual = false;
- }
-
- if (this._maximumWalkDistance != obj._maximumWalkDistance)
- {
- ivarsEqual = false;
- }
-
- if (this._keepTime != obj._keepTime)
- {
- ivarsEqual = false;
- }
-
- if (this._echoSpacing != obj._echoSpacing)
- {
- ivarsEqual = false;
- }
-
- if (this._padding3 != obj._padding3)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._recordType.GetHashCode();
- result = GenerateHash(result) ^ this._recordLength.GetHashCode();
- result = GenerateHash(result) ^ this._padding.GetHashCode();
- result = GenerateHash(result) ^ this._emitterNumber.GetHashCode();
- result = GenerateHash(result) ^ this._beamNumber.GetHashCode();
- result = GenerateHash(result) ^ this._stateIndicator.GetHashCode();
- result = GenerateHash(result) ^ this._padding2.GetHashCode();
- result = GenerateHash(result) ^ this._falseTargetCount.GetHashCode();
- result = GenerateHash(result) ^ this._walkSpeed.GetHashCode();
- result = GenerateHash(result) ^ this._walkAcceleration.GetHashCode();
- result = GenerateHash(result) ^ this._maximumWalkDistance.GetHashCode();
- result = GenerateHash(result) ^ this._keepTime.GetHashCode();
- result = GenerateHash(result) ^ this._echoSpacing.GetHashCode();
- result = GenerateHash(result) ^ this._padding3.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/FastEntityStatePdu.cs b/tests/OpenDisNet.Reference/Generated/FastEntityStatePdu.cs
deleted file mode 100644
index 4c45e08..0000000
--- a/tests/OpenDisNet.Reference/Generated/FastEntityStatePdu.cs
+++ /dev/null
@@ -1,1590 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Represents the postion and state of one entity in the world. This is identical in function to entity state pdu, but generates less garbage to collect in the Java world. Section 7.2.2. COMPLETE
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(VariableParameter))]
- public partial class FastEntityStatePdu : EntityInformationFamilyPdu, IEquatable
- {
- ///
- /// The site ID
- ///
- private ushort _site;
-
- ///
- /// The application ID
- ///
- private ushort _application;
-
- ///
- /// the entity ID
- ///
- private ushort _entity;
-
- ///
- /// what force this entity is affiliated with, eg red, blue, neutral, etc
- ///
- private byte _forceId;
-
- ///
- /// How many variable (nee articulation) parameters are in the variable length list
- ///
- private byte _numberOfVariableParameters;
-
- ///
- /// Kind of entity
- ///
- private byte _entityKind;
-
- ///
- /// Domain of entity (air, surface, subsurface, space, etc)
- ///
- private byte _domain;
-
- ///
- /// country to which the design of the entity is attributed
- ///
- private ushort _country;
-
- ///
- /// category of entity
- ///
- private byte _category;
-
- ///
- /// subcategory of entity
- ///
- private byte _subcategory;
-
- ///
- /// specific info based on subcategory field
- ///
- private byte _specific;
-
- private byte _extra;
-
- ///
- /// Kind of entity
- ///
- private byte _altEntityKind;
-
- ///
- /// Domain of entity (air, surface, subsurface, space, etc)
- ///
- private byte _altDomain;
-
- ///
- /// country to which the design of the entity is attributed
- ///
- private ushort _altCountry;
-
- ///
- /// category of entity
- ///
- private byte _altCategory;
-
- ///
- /// subcategory of entity
- ///
- private byte _altSubcategory;
-
- ///
- /// specific info based on subcategory field
- ///
- private byte _altSpecific;
-
- private byte _altExtra;
-
- ///
- /// X velo
- ///
- private float _xVelocity;
-
- ///
- /// y Value
- ///
- private float _yVelocity;
-
- ///
- /// Z value
- ///
- private float _zVelocity;
-
- ///
- /// X value
- ///
- private double _xLocation;
-
- ///
- /// y Value
- ///
- private double _yLocation;
-
- ///
- /// Z value
- ///
- private double _zLocation;
-
- private float _psi;
-
- private float _theta;
-
- private float _phi;
-
- ///
- /// a series of bit flags that are used to help draw the entity, such as smoking, on fire, etc.
- ///
- private int _entityAppearance;
-
- ///
- /// enumeration of what dead reckoning algorighm to use
- ///
- private byte _deadReckoningAlgorithm;
-
- ///
- /// other parameters to use in the dead reckoning algorithm
- ///
- private byte[] _otherParameters = new byte[15];
-
- ///
- /// X value
- ///
- private float _xAcceleration;
-
- ///
- /// y Value
- ///
- private float _yAcceleration;
-
- ///
- /// Z value
- ///
- private float _zAcceleration;
-
- ///
- /// X value
- ///
- private float _xAngularVelocity;
-
- ///
- /// y Value
- ///
- private float _yAngularVelocity;
-
- ///
- /// Z value
- ///
- private float _zAngularVelocity;
-
- ///
- /// characters that can be used for debugging, or to draw unique strings on the side of entities in the world
- ///
- private byte[] _marking = new byte[12];
-
- ///
- /// a series of bit flags
- ///
- private int _capabilities;
-
- ///
- /// variable length list of variable parameters. In earlier versions of DIS these were known as articulation parameters
- ///
- private List _variableParameters = new List();
-
- ///
- /// Initializes a new instance of the class.
- ///
- public FastEntityStatePdu()
- {
- PduType = (byte)1;
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(FastEntityStatePdu left, FastEntityStatePdu right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(FastEntityStatePdu left, FastEntityStatePdu right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public override int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize = base.GetMarshalledSize();
- marshalSize += 2; // this._site
- marshalSize += 2; // this._application
- marshalSize += 2; // this._entity
- marshalSize += 1; // this._forceId
- marshalSize += 1; // this._numberOfVariableParameters
- marshalSize += 1; // this._entityKind
- marshalSize += 1; // this._domain
- marshalSize += 2; // this._country
- marshalSize += 1; // this._category
- marshalSize += 1; // this._subcategory
- marshalSize += 1; // this._specific
- marshalSize += 1; // this._extra
- marshalSize += 1; // this._altEntityKind
- marshalSize += 1; // this._altDomain
- marshalSize += 2; // this._altCountry
- marshalSize += 1; // this._altCategory
- marshalSize += 1; // this._altSubcategory
- marshalSize += 1; // this._altSpecific
- marshalSize += 1; // this._altExtra
- marshalSize += 4; // this._xVelocity
- marshalSize += 4; // this._yVelocity
- marshalSize += 4; // this._zVelocity
- marshalSize += 8; // this._xLocation
- marshalSize += 8; // this._yLocation
- marshalSize += 8; // this._zLocation
- marshalSize += 4; // this._psi
- marshalSize += 4; // this._theta
- marshalSize += 4; // this._phi
- marshalSize += 4; // this._entityAppearance
- marshalSize += 1; // this._deadReckoningAlgorithm
- marshalSize += 15 * 1; // _otherParameters
- marshalSize += 4; // this._xAcceleration
- marshalSize += 4; // this._yAcceleration
- marshalSize += 4; // this._zAcceleration
- marshalSize += 4; // this._xAngularVelocity
- marshalSize += 4; // this._yAngularVelocity
- marshalSize += 4; // this._zAngularVelocity
- marshalSize += 12 * 1; // _marking
- marshalSize += 4; // this._capabilities
- for (int idx = 0; idx < this._variableParameters.Count; idx++)
- {
- VariableParameter listElement = (VariableParameter)this._variableParameters[idx];
- marshalSize += listElement.GetMarshalledSize();
- }
-
- return marshalSize;
- }
-
- ///
- /// Gets or sets the The site ID
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "site")]
- public ushort Site
- {
- get
- {
- return this._site;
- }
-
- set
- {
- this._site = value;
- }
- }
-
- ///
- /// Gets or sets the The application ID
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "application")]
- public ushort Application
- {
- get
- {
- return this._application;
- }
-
- set
- {
- this._application = value;
- }
- }
-
- ///
- /// Gets or sets the the entity ID
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "entity")]
- public ushort Entity
- {
- get
- {
- return this._entity;
- }
-
- set
- {
- this._entity = value;
- }
- }
-
- ///
- /// Gets or sets the what force this entity is affiliated with, eg red, blue, neutral, etc
- ///
- [XmlElement(Type = typeof(byte), ElementName = "forceId")]
- public byte ForceId
- {
- get
- {
- return this._forceId;
- }
-
- set
- {
- this._forceId = value;
- }
- }
-
- ///
- /// Note that setting this value will not change the marshalled value. The list whose length this describes is used for that purpose.
- /// The getnumberOfVariableParameters method will also be based on the actual list length rather than this value.
- /// The method is simply here for completeness and should not be used for any computations.
- ///
- [XmlElement(Type = typeof(byte), ElementName = "numberOfVariableParameters")]
- public byte NumberOfVariableParameters
- {
- get
- {
- return this._numberOfVariableParameters;
- }
-
- set
- {
- this._numberOfVariableParameters = value;
- }
- }
-
- ///
- /// Gets or sets the Kind of entity
- ///
- [XmlElement(Type = typeof(byte), ElementName = "entityKind")]
- public byte EntityKind
- {
- get
- {
- return this._entityKind;
- }
-
- set
- {
- this._entityKind = value;
- }
- }
-
- ///
- /// Gets or sets the Domain of entity (air, surface, subsurface, space, etc)
- ///
- [XmlElement(Type = typeof(byte), ElementName = "domain")]
- public byte Domain
- {
- get
- {
- return this._domain;
- }
-
- set
- {
- this._domain = value;
- }
- }
-
- ///
- /// Gets or sets the country to which the design of the entity is attributed
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "country")]
- public ushort Country
- {
- get
- {
- return this._country;
- }
-
- set
- {
- this._country = value;
- }
- }
-
- ///
- /// Gets or sets the category of entity
- ///
- [XmlElement(Type = typeof(byte), ElementName = "category")]
- public byte Category
- {
- get
- {
- return this._category;
- }
-
- set
- {
- this._category = value;
- }
- }
-
- ///
- /// Gets or sets the subcategory of entity
- ///
- [XmlElement(Type = typeof(byte), ElementName = "subcategory")]
- public byte Subcategory
- {
- get
- {
- return this._subcategory;
- }
-
- set
- {
- this._subcategory = value;
- }
- }
-
- ///
- /// Gets or sets the specific info based on subcategory field
- ///
- [XmlElement(Type = typeof(byte), ElementName = "specific")]
- public byte Specific
- {
- get
- {
- return this._specific;
- }
-
- set
- {
- this._specific = value;
- }
- }
-
- [XmlElement(Type = typeof(byte), ElementName = "extra")]
- public byte Extra
- {
- get
- {
- return this._extra;
- }
-
- set
- {
- this._extra = value;
- }
- }
-
- ///
- /// Gets or sets the Kind of entity
- ///
- [XmlElement(Type = typeof(byte), ElementName = "altEntityKind")]
- public byte AltEntityKind
- {
- get
- {
- return this._altEntityKind;
- }
-
- set
- {
- this._altEntityKind = value;
- }
- }
-
- ///
- /// Gets or sets the Domain of entity (air, surface, subsurface, space, etc)
- ///
- [XmlElement(Type = typeof(byte), ElementName = "altDomain")]
- public byte AltDomain
- {
- get
- {
- return this._altDomain;
- }
-
- set
- {
- this._altDomain = value;
- }
- }
-
- ///
- /// Gets or sets the country to which the design of the entity is attributed
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "altCountry")]
- public ushort AltCountry
- {
- get
- {
- return this._altCountry;
- }
-
- set
- {
- this._altCountry = value;
- }
- }
-
- ///
- /// Gets or sets the category of entity
- ///
- [XmlElement(Type = typeof(byte), ElementName = "altCategory")]
- public byte AltCategory
- {
- get
- {
- return this._altCategory;
- }
-
- set
- {
- this._altCategory = value;
- }
- }
-
- ///
- /// Gets or sets the subcategory of entity
- ///
- [XmlElement(Type = typeof(byte), ElementName = "altSubcategory")]
- public byte AltSubcategory
- {
- get
- {
- return this._altSubcategory;
- }
-
- set
- {
- this._altSubcategory = value;
- }
- }
-
- ///
- /// Gets or sets the specific info based on subcategory field
- ///
- [XmlElement(Type = typeof(byte), ElementName = "altSpecific")]
- public byte AltSpecific
- {
- get
- {
- return this._altSpecific;
- }
-
- set
- {
- this._altSpecific = value;
- }
- }
-
- [XmlElement(Type = typeof(byte), ElementName = "altExtra")]
- public byte AltExtra
- {
- get
- {
- return this._altExtra;
- }
-
- set
- {
- this._altExtra = value;
- }
- }
-
- ///
- /// Gets or sets the X velo
- ///
- [XmlElement(Type = typeof(float), ElementName = "xVelocity")]
- public float XVelocity
- {
- get
- {
- return this._xVelocity;
- }
-
- set
- {
- this._xVelocity = value;
- }
- }
-
- ///
- /// Gets or sets the y Value
- ///
- [XmlElement(Type = typeof(float), ElementName = "yVelocity")]
- public float YVelocity
- {
- get
- {
- return this._yVelocity;
- }
-
- set
- {
- this._yVelocity = value;
- }
- }
-
- ///
- /// Gets or sets the Z value
- ///
- [XmlElement(Type = typeof(float), ElementName = "zVelocity")]
- public float ZVelocity
- {
- get
- {
- return this._zVelocity;
- }
-
- set
- {
- this._zVelocity = value;
- }
- }
-
- ///
- /// Gets or sets the X value
- ///
- [XmlElement(Type = typeof(double), ElementName = "xLocation")]
- public double XLocation
- {
- get
- {
- return this._xLocation;
- }
-
- set
- {
- this._xLocation = value;
- }
- }
-
- ///
- /// Gets or sets the y Value
- ///
- [XmlElement(Type = typeof(double), ElementName = "yLocation")]
- public double YLocation
- {
- get
- {
- return this._yLocation;
- }
-
- set
- {
- this._yLocation = value;
- }
- }
-
- ///
- /// Gets or sets the Z value
- ///
- [XmlElement(Type = typeof(double), ElementName = "zLocation")]
- public double ZLocation
- {
- get
- {
- return this._zLocation;
- }
-
- set
- {
- this._zLocation = value;
- }
- }
-
- [XmlElement(Type = typeof(float), ElementName = "psi")]
- public float Psi
- {
- get
- {
- return this._psi;
- }
-
- set
- {
- this._psi = value;
- }
- }
-
- [XmlElement(Type = typeof(float), ElementName = "theta")]
- public float Theta
- {
- get
- {
- return this._theta;
- }
-
- set
- {
- this._theta = value;
- }
- }
-
- [XmlElement(Type = typeof(float), ElementName = "phi")]
- public float Phi
- {
- get
- {
- return this._phi;
- }
-
- set
- {
- this._phi = value;
- }
- }
-
- ///
- /// Gets or sets the a series of bit flags that are used to help draw the entity, such as smoking, on fire, etc.
- ///
- [XmlElement(Type = typeof(int), ElementName = "entityAppearance")]
- public int EntityAppearance
- {
- get
- {
- return this._entityAppearance;
- }
-
- set
- {
- this._entityAppearance = value;
- }
- }
-
- ///
- /// Gets or sets the enumeration of what dead reckoning algorighm to use
- ///
- [XmlElement(Type = typeof(byte), ElementName = "deadReckoningAlgorithm")]
- public byte DeadReckoningAlgorithm
- {
- get
- {
- return this._deadReckoningAlgorithm;
- }
-
- set
- {
- this._deadReckoningAlgorithm = value;
- }
- }
-
- ///
- /// Gets or sets the other parameters to use in the dead reckoning algorithm
- ///
- [XmlArray(ElementName = "otherParameters")]
- public byte[] OtherParameters
- {
- get
- {
- return this._otherParameters;
- }
-
- set
- {
- this._otherParameters = value;
- }
-}
-
- ///
- /// Gets or sets the X value
- ///
- [XmlElement(Type = typeof(float), ElementName = "xAcceleration")]
- public float XAcceleration
- {
- get
- {
- return this._xAcceleration;
- }
-
- set
- {
- this._xAcceleration = value;
- }
- }
-
- ///
- /// Gets or sets the y Value
- ///
- [XmlElement(Type = typeof(float), ElementName = "yAcceleration")]
- public float YAcceleration
- {
- get
- {
- return this._yAcceleration;
- }
-
- set
- {
- this._yAcceleration = value;
- }
- }
-
- ///
- /// Gets or sets the Z value
- ///
- [XmlElement(Type = typeof(float), ElementName = "zAcceleration")]
- public float ZAcceleration
- {
- get
- {
- return this._zAcceleration;
- }
-
- set
- {
- this._zAcceleration = value;
- }
- }
-
- ///
- /// Gets or sets the X value
- ///
- [XmlElement(Type = typeof(float), ElementName = "xAngularVelocity")]
- public float XAngularVelocity
- {
- get
- {
- return this._xAngularVelocity;
- }
-
- set
- {
- this._xAngularVelocity = value;
- }
- }
-
- ///
- /// Gets or sets the y Value
- ///
- [XmlElement(Type = typeof(float), ElementName = "yAngularVelocity")]
- public float YAngularVelocity
- {
- get
- {
- return this._yAngularVelocity;
- }
-
- set
- {
- this._yAngularVelocity = value;
- }
- }
-
- ///
- /// Gets or sets the Z value
- ///
- [XmlElement(Type = typeof(float), ElementName = "zAngularVelocity")]
- public float ZAngularVelocity
- {
- get
- {
- return this._zAngularVelocity;
- }
-
- set
- {
- this._zAngularVelocity = value;
- }
- }
-
- ///
- /// Gets or sets the characters that can be used for debugging, or to draw unique strings on the side of entities in the world
- ///
- [XmlArray(ElementName = "marking")]
- public byte[] Marking
- {
- get
- {
- return this._marking;
- }
-
- set
- {
- this._marking = value;
- }
-}
-
- ///
- /// Gets or sets the a series of bit flags
- ///
- [XmlElement(Type = typeof(int), ElementName = "capabilities")]
- public int Capabilities
- {
- get
- {
- return this._capabilities;
- }
-
- set
- {
- this._capabilities = value;
- }
- }
-
- ///
- /// Gets or sets the variable length list of variable parameters. In earlier versions of DIS these were known as articulation parameters
- ///
- [XmlElement(ElementName = "variableParametersList", Type = typeof(List))]
- public List VariableParameters
- {
- get
- {
- return this._variableParameters;
- }
- }
-
- ///
- /// Automatically sets the length of the marshalled data, then calls the marshal method.
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- public override void MarshalAutoLengthSet(DataOutputStream dos)
- {
- // Set the length prior to marshalling data
- this.Length = (ushort)this.GetMarshalledSize();
- this.Marshal(dos);
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Marshal(DataOutputStream dos)
- {
- base.Marshal(dos);
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedShort((ushort)this._site);
- dos.WriteUnsignedShort((ushort)this._application);
- dos.WriteUnsignedShort((ushort)this._entity);
- dos.WriteUnsignedByte((byte)this._forceId);
- dos.WriteByte((byte)this._variableParameters.Count);
- dos.WriteUnsignedByte((byte)this._entityKind);
- dos.WriteUnsignedByte((byte)this._domain);
- dos.WriteUnsignedShort((ushort)this._country);
- dos.WriteUnsignedByte((byte)this._category);
- dos.WriteUnsignedByte((byte)this._subcategory);
- dos.WriteUnsignedByte((byte)this._specific);
- dos.WriteUnsignedByte((byte)this._extra);
- dos.WriteUnsignedByte((byte)this._altEntityKind);
- dos.WriteUnsignedByte((byte)this._altDomain);
- dos.WriteUnsignedShort((ushort)this._altCountry);
- dos.WriteUnsignedByte((byte)this._altCategory);
- dos.WriteUnsignedByte((byte)this._altSubcategory);
- dos.WriteUnsignedByte((byte)this._altSpecific);
- dos.WriteUnsignedByte((byte)this._altExtra);
- dos.WriteFloat((float)this._xVelocity);
- dos.WriteFloat((float)this._yVelocity);
- dos.WriteFloat((float)this._zVelocity);
- dos.WriteDouble((double)this._xLocation);
- dos.WriteDouble((double)this._yLocation);
- dos.WriteDouble((double)this._zLocation);
- dos.WriteFloat((float)this._psi);
- dos.WriteFloat((float)this._theta);
- dos.WriteFloat((float)this._phi);
- dos.WriteInt((int)this._entityAppearance);
- dos.WriteUnsignedByte((byte)this._deadReckoningAlgorithm);
-
- for (int idx = 0; idx < this._otherParameters.Length; idx++)
- {
- dos.WriteByte(this._otherParameters[idx]);
- }
- dos.WriteFloat((float)this._xAcceleration);
- dos.WriteFloat((float)this._yAcceleration);
- dos.WriteFloat((float)this._zAcceleration);
- dos.WriteFloat((float)this._xAngularVelocity);
- dos.WriteFloat((float)this._yAngularVelocity);
- dos.WriteFloat((float)this._zAngularVelocity);
-
- for (int idx = 0; idx < this._marking.Length; idx++)
- {
- dos.WriteByte(this._marking[idx]);
- }
- dos.WriteInt((int)this._capabilities);
-
- for (int idx = 0; idx < this._variableParameters.Count; idx++)
- {
- VariableParameter aVariableParameter = (VariableParameter)this._variableParameters[idx];
- aVariableParameter.Marshal(dos);
- }
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Unmarshal(DataInputStream dis)
- {
- base.Unmarshal(dis);
-
- if (dis != null)
- {
- try
- {
- this._site = dis.ReadUnsignedShort();
- this._application = dis.ReadUnsignedShort();
- this._entity = dis.ReadUnsignedShort();
- this._forceId = dis.ReadUnsignedByte();
- this._numberOfVariableParameters = dis.ReadByte();
- this._entityKind = dis.ReadUnsignedByte();
- this._domain = dis.ReadUnsignedByte();
- this._country = dis.ReadUnsignedShort();
- this._category = dis.ReadUnsignedByte();
- this._subcategory = dis.ReadUnsignedByte();
- this._specific = dis.ReadUnsignedByte();
- this._extra = dis.ReadUnsignedByte();
- this._altEntityKind = dis.ReadUnsignedByte();
- this._altDomain = dis.ReadUnsignedByte();
- this._altCountry = dis.ReadUnsignedShort();
- this._altCategory = dis.ReadUnsignedByte();
- this._altSubcategory = dis.ReadUnsignedByte();
- this._altSpecific = dis.ReadUnsignedByte();
- this._altExtra = dis.ReadUnsignedByte();
- this._xVelocity = dis.ReadFloat();
- this._yVelocity = dis.ReadFloat();
- this._zVelocity = dis.ReadFloat();
- this._xLocation = dis.ReadDouble();
- this._yLocation = dis.ReadDouble();
- this._zLocation = dis.ReadDouble();
- this._psi = dis.ReadFloat();
- this._theta = dis.ReadFloat();
- this._phi = dis.ReadFloat();
- this._entityAppearance = dis.ReadInt();
- this._deadReckoningAlgorithm = dis.ReadUnsignedByte();
- for (int idx = 0; idx < this._otherParameters.Length; idx++)
- {
- this._otherParameters[idx] = dis.ReadByte();
- }
- this._xAcceleration = dis.ReadFloat();
- this._yAcceleration = dis.ReadFloat();
- this._zAcceleration = dis.ReadFloat();
- this._xAngularVelocity = dis.ReadFloat();
- this._yAngularVelocity = dis.ReadFloat();
- this._zAngularVelocity = dis.ReadFloat();
- for (int idx = 0; idx < this._marking.Length; idx++)
- {
- this._marking[idx] = dis.ReadByte();
- }
- this._capabilities = dis.ReadInt();
- for (int idx = 0; idx < this.NumberOfVariableParameters; idx++)
- {
- VariableParameter anX = new VariableParameter();
- anX.Unmarshal(dis);
- this._variableParameters.Add(anX);
- };
-
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- base.Reflection(sb);
- try
- {
- sb.AppendLine("" + this._site.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._application.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._entity.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._forceId.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._variableParameters.Count.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._entityKind.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._domain.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._country.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._category.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._subcategory.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._specific.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._extra.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._altEntityKind.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._altDomain.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._altCountry.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._altCategory.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._altSubcategory.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._altSpecific.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._altExtra.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._xVelocity.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._yVelocity.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._zVelocity.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._xLocation.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._yLocation.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._zLocation.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._psi.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._theta.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._phi.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._entityAppearance.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._deadReckoningAlgorithm.ToString(CultureInfo.InvariantCulture) + "");
- for (int idx = 0; idx < this._otherParameters.Length; idx++)
- {
- sb.AppendLine("" + this._otherParameters[idx] + "");
- }
-
- sb.AppendLine("" + this._xAcceleration.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._yAcceleration.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._zAcceleration.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._xAngularVelocity.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._yAngularVelocity.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._zAngularVelocity.ToString(CultureInfo.InvariantCulture) + "");
- for (int idx = 0; idx < this._marking.Length; idx++)
- {
- sb.AppendLine("" + this._marking[idx] + "");
- }
-
- sb.AppendLine("" + this._capabilities.ToString(CultureInfo.InvariantCulture) + "");
- for (int idx = 0; idx < this._variableParameters.Count; idx++)
- {
- sb.AppendLine("");
- VariableParameter aVariableParameter = (VariableParameter)this._variableParameters[idx];
- aVariableParameter.Reflection(sb);
- sb.AppendLine("");
- }
-
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as FastEntityStatePdu;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(FastEntityStatePdu obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- ivarsEqual = base.Equals(obj);
-
- if (this._site != obj._site)
- {
- ivarsEqual = false;
- }
-
- if (this._application != obj._application)
- {
- ivarsEqual = false;
- }
-
- if (this._entity != obj._entity)
- {
- ivarsEqual = false;
- }
-
- if (this._forceId != obj._forceId)
- {
- ivarsEqual = false;
- }
-
- if (this._numberOfVariableParameters != obj._numberOfVariableParameters)
- {
- ivarsEqual = false;
- }
-
- if (this._entityKind != obj._entityKind)
- {
- ivarsEqual = false;
- }
-
- if (this._domain != obj._domain)
- {
- ivarsEqual = false;
- }
-
- if (this._country != obj._country)
- {
- ivarsEqual = false;
- }
-
- if (this._category != obj._category)
- {
- ivarsEqual = false;
- }
-
- if (this._subcategory != obj._subcategory)
- {
- ivarsEqual = false;
- }
-
- if (this._specific != obj._specific)
- {
- ivarsEqual = false;
- }
-
- if (this._extra != obj._extra)
- {
- ivarsEqual = false;
- }
-
- if (this._altEntityKind != obj._altEntityKind)
- {
- ivarsEqual = false;
- }
-
- if (this._altDomain != obj._altDomain)
- {
- ivarsEqual = false;
- }
-
- if (this._altCountry != obj._altCountry)
- {
- ivarsEqual = false;
- }
-
- if (this._altCategory != obj._altCategory)
- {
- ivarsEqual = false;
- }
-
- if (this._altSubcategory != obj._altSubcategory)
- {
- ivarsEqual = false;
- }
-
- if (this._altSpecific != obj._altSpecific)
- {
- ivarsEqual = false;
- }
-
- if (this._altExtra != obj._altExtra)
- {
- ivarsEqual = false;
- }
-
- if (this._xVelocity != obj._xVelocity)
- {
- ivarsEqual = false;
- }
-
- if (this._yVelocity != obj._yVelocity)
- {
- ivarsEqual = false;
- }
-
- if (this._zVelocity != obj._zVelocity)
- {
- ivarsEqual = false;
- }
-
- if (this._xLocation != obj._xLocation)
- {
- ivarsEqual = false;
- }
-
- if (this._yLocation != obj._yLocation)
- {
- ivarsEqual = false;
- }
-
- if (this._zLocation != obj._zLocation)
- {
- ivarsEqual = false;
- }
-
- if (this._psi != obj._psi)
- {
- ivarsEqual = false;
- }
-
- if (this._theta != obj._theta)
- {
- ivarsEqual = false;
- }
-
- if (this._phi != obj._phi)
- {
- ivarsEqual = false;
- }
-
- if (this._entityAppearance != obj._entityAppearance)
- {
- ivarsEqual = false;
- }
-
- if (this._deadReckoningAlgorithm != obj._deadReckoningAlgorithm)
- {
- ivarsEqual = false;
- }
-
- if (obj._otherParameters.Length != 15)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < 15; idx++)
- {
- if (this._otherParameters[idx] != obj._otherParameters[idx])
- {
- ivarsEqual = false;
- }
- }
- }
-
- if (this._xAcceleration != obj._xAcceleration)
- {
- ivarsEqual = false;
- }
-
- if (this._yAcceleration != obj._yAcceleration)
- {
- ivarsEqual = false;
- }
-
- if (this._zAcceleration != obj._zAcceleration)
- {
- ivarsEqual = false;
- }
-
- if (this._xAngularVelocity != obj._xAngularVelocity)
- {
- ivarsEqual = false;
- }
-
- if (this._yAngularVelocity != obj._yAngularVelocity)
- {
- ivarsEqual = false;
- }
-
- if (this._zAngularVelocity != obj._zAngularVelocity)
- {
- ivarsEqual = false;
- }
-
- if (obj._marking.Length != 12)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < 12; idx++)
- {
- if (this._marking[idx] != obj._marking[idx])
- {
- ivarsEqual = false;
- }
- }
- }
-
- if (this._capabilities != obj._capabilities)
- {
- ivarsEqual = false;
- }
-
- if (this._variableParameters.Count != obj._variableParameters.Count)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < this._variableParameters.Count; idx++)
- {
- if (!this._variableParameters[idx].Equals(obj._variableParameters[idx]))
- {
- ivarsEqual = false;
- }
- }
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ base.GetHashCode();
-
- result = GenerateHash(result) ^ this._site.GetHashCode();
- result = GenerateHash(result) ^ this._application.GetHashCode();
- result = GenerateHash(result) ^ this._entity.GetHashCode();
- result = GenerateHash(result) ^ this._forceId.GetHashCode();
- result = GenerateHash(result) ^ this._numberOfVariableParameters.GetHashCode();
- result = GenerateHash(result) ^ this._entityKind.GetHashCode();
- result = GenerateHash(result) ^ this._domain.GetHashCode();
- result = GenerateHash(result) ^ this._country.GetHashCode();
- result = GenerateHash(result) ^ this._category.GetHashCode();
- result = GenerateHash(result) ^ this._subcategory.GetHashCode();
- result = GenerateHash(result) ^ this._specific.GetHashCode();
- result = GenerateHash(result) ^ this._extra.GetHashCode();
- result = GenerateHash(result) ^ this._altEntityKind.GetHashCode();
- result = GenerateHash(result) ^ this._altDomain.GetHashCode();
- result = GenerateHash(result) ^ this._altCountry.GetHashCode();
- result = GenerateHash(result) ^ this._altCategory.GetHashCode();
- result = GenerateHash(result) ^ this._altSubcategory.GetHashCode();
- result = GenerateHash(result) ^ this._altSpecific.GetHashCode();
- result = GenerateHash(result) ^ this._altExtra.GetHashCode();
- result = GenerateHash(result) ^ this._xVelocity.GetHashCode();
- result = GenerateHash(result) ^ this._yVelocity.GetHashCode();
- result = GenerateHash(result) ^ this._zVelocity.GetHashCode();
- result = GenerateHash(result) ^ this._xLocation.GetHashCode();
- result = GenerateHash(result) ^ this._yLocation.GetHashCode();
- result = GenerateHash(result) ^ this._zLocation.GetHashCode();
- result = GenerateHash(result) ^ this._psi.GetHashCode();
- result = GenerateHash(result) ^ this._theta.GetHashCode();
- result = GenerateHash(result) ^ this._phi.GetHashCode();
- result = GenerateHash(result) ^ this._entityAppearance.GetHashCode();
- result = GenerateHash(result) ^ this._deadReckoningAlgorithm.GetHashCode();
-
- for (int idx = 0; idx < 15; idx++)
- {
- result = GenerateHash(result) ^ this._otherParameters[idx].GetHashCode();
- }
- result = GenerateHash(result) ^ this._xAcceleration.GetHashCode();
- result = GenerateHash(result) ^ this._yAcceleration.GetHashCode();
- result = GenerateHash(result) ^ this._zAcceleration.GetHashCode();
- result = GenerateHash(result) ^ this._xAngularVelocity.GetHashCode();
- result = GenerateHash(result) ^ this._yAngularVelocity.GetHashCode();
- result = GenerateHash(result) ^ this._zAngularVelocity.GetHashCode();
-
- for (int idx = 0; idx < 12; idx++)
- {
- result = GenerateHash(result) ^ this._marking[idx].GetHashCode();
- }
- result = GenerateHash(result) ^ this._capabilities.GetHashCode();
-
- if (this._variableParameters.Count > 0)
- {
- for (int idx = 0; idx < this._variableParameters.Count; idx++)
- {
- result = GenerateHash(result) ^ this._variableParameters[idx].GetHashCode();
- }
- }
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/FirePdu.cs b/tests/OpenDisNet.Reference/Generated/FirePdu.cs
deleted file mode 100644
index 9f8490e..0000000
--- a/tests/OpenDisNet.Reference/Generated/FirePdu.cs
+++ /dev/null
@@ -1,488 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// The firing of a weapon or expendable shall be communicated by issuing a Fire PDU. Sectioin 7.3.2. COMPLETE
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(EntityID))]
- [XmlInclude(typeof(EventIdentifier))]
- [XmlInclude(typeof(Vector3Double))]
- [XmlInclude(typeof(MunitionDescriptor))]
- [XmlInclude(typeof(Vector3Float))]
- public partial class FirePdu : WarfareFamilyPdu, IEquatable
- {
- ///
- /// This field shall specify the entity identification of the fired munition or expendable. This field shall be represented by an Entity Identifier record (see 6.2.28).
- ///
- private EntityID _munitionExpendibleID = new EntityID();
-
- ///
- /// This field shall contain an identification generated by the firing entity to associate related firing and detonation events. This field shall be represented by an Event Identifier record (see 6.2.34).
- ///
- private EventIdentifier _eventID = new EventIdentifier();
-
- ///
- /// This field shall identify the fire mission (see 5.4.3.3). This field shall be representedby a 32-bit unsigned integer.
- ///
- private uint _fireMissionIndex;
-
- ///
- /// This field shall specify the location, in world coordinates, from which the munition was launched, and shall be represented by a World Coordinates record (see 6.2.97).
- ///
- private Vector3Double _locationInWorldCoordinates = new Vector3Double();
-
- ///
- /// This field shall describe the firing or launch of a munition or expendable represented by one of the following types of Descriptor records: Munition Descriptor (6.2.20.2) or Expendable Descriptor (6.2.20.4).
- ///
- private MunitionDescriptor _descriptor = new MunitionDescriptor();
-
- ///
- /// This field shall specify the velocity of the fired munition at the point when the issuing simulation application intends the externally visible effects of the launch (e.g. exhaust plume or muzzle blast) to first become apparent. The velocity shall be represented in world coordinates. This field shall be represented by a Linear Velocity Vector record [see 6.2.95 item c)].
- ///
- private Vector3Float _velocity = new Vector3Float();
-
- ///
- /// This field shall specify the range that an entity’s fire control system has assumed in computing the fire control solution. This field shall be represented by a 32-bit floating point number in meters. For systems where range is unknown or unavailable, this field shall contain a value of zero.
- ///
- private float _range;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public FirePdu()
- {
- PduType = (byte)2;
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(FirePdu left, FirePdu right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(FirePdu left, FirePdu right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public override int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize = base.GetMarshalledSize();
- marshalSize += this._munitionExpendibleID.GetMarshalledSize(); // this._munitionExpendibleID
- marshalSize += this._eventID.GetMarshalledSize(); // this._eventID
- marshalSize += 4; // this._fireMissionIndex
- marshalSize += this._locationInWorldCoordinates.GetMarshalledSize(); // this._locationInWorldCoordinates
- marshalSize += this._descriptor.GetMarshalledSize(); // this._descriptor
- marshalSize += this._velocity.GetMarshalledSize(); // this._velocity
- marshalSize += 4; // this._range
- return marshalSize;
- }
-
- ///
- /// Gets or sets the This field shall specify the entity identification of the fired munition or expendable. This field shall be represented by an Entity Identifier record (see 6.2.28).
- ///
- [XmlElement(Type = typeof(EntityID), ElementName = "munitionExpendibleID")]
- public EntityID MunitionExpendibleID
- {
- get
- {
- return this._munitionExpendibleID;
- }
-
- set
- {
- this._munitionExpendibleID = value;
- }
- }
-
- ///
- /// Gets or sets the This field shall contain an identification generated by the firing entity to associate related firing and detonation events. This field shall be represented by an Event Identifier record (see 6.2.34).
- ///
- [XmlElement(Type = typeof(EventIdentifier), ElementName = "eventID")]
- public EventIdentifier EventID
- {
- get
- {
- return this._eventID;
- }
-
- set
- {
- this._eventID = value;
- }
- }
-
- ///
- /// Gets or sets the This field shall identify the fire mission (see 5.4.3.3). This field shall be representedby a 32-bit unsigned integer.
- ///
- [XmlElement(Type = typeof(uint), ElementName = "fireMissionIndex")]
- public uint FireMissionIndex
- {
- get
- {
- return this._fireMissionIndex;
- }
-
- set
- {
- this._fireMissionIndex = value;
- }
- }
-
- ///
- /// Gets or sets the This field shall specify the location, in world coordinates, from which the munition was launched, and shall be represented by a World Coordinates record (see 6.2.97).
- ///
- [XmlElement(Type = typeof(Vector3Double), ElementName = "locationInWorldCoordinates")]
- public Vector3Double LocationInWorldCoordinates
- {
- get
- {
- return this._locationInWorldCoordinates;
- }
-
- set
- {
- this._locationInWorldCoordinates = value;
- }
- }
-
- ///
- /// Gets or sets the This field shall describe the firing or launch of a munition or expendable represented by one of the following types of Descriptor records: Munition Descriptor (6.2.20.2) or Expendable Descriptor (6.2.20.4).
- ///
- [XmlElement(Type = typeof(MunitionDescriptor), ElementName = "descriptor")]
- public MunitionDescriptor Descriptor
- {
- get
- {
- return this._descriptor;
- }
-
- set
- {
- this._descriptor = value;
- }
- }
-
- ///
- /// Gets or sets the This field shall specify the velocity of the fired munition at the point when the issuing simulation application intends the externally visible effects of the launch (e.g. exhaust plume or muzzle blast) to first become apparent. The velocity shall be represented in world coordinates. This field shall be represented by a Linear Velocity Vector record [see 6.2.95 item c)].
- ///
- [XmlElement(Type = typeof(Vector3Float), ElementName = "velocity")]
- public Vector3Float Velocity
- {
- get
- {
- return this._velocity;
- }
-
- set
- {
- this._velocity = value;
- }
- }
-
- ///
- /// Gets or sets the This field shall specify the range that an entity’s fire control system has assumed in computing the fire control solution. This field shall be represented by a 32-bit floating point number in meters. For systems where range is unknown or unavailable, this field shall contain a value of zero.
- ///
- [XmlElement(Type = typeof(float), ElementName = "range")]
- public float Range
- {
- get
- {
- return this._range;
- }
-
- set
- {
- this._range = value;
- }
- }
-
- ///
- /// Automatically sets the length of the marshalled data, then calls the marshal method.
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- public override void MarshalAutoLengthSet(DataOutputStream dos)
- {
- // Set the length prior to marshalling data
- this.Length = (ushort)this.GetMarshalledSize();
- this.Marshal(dos);
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Marshal(DataOutputStream dos)
- {
- base.Marshal(dos);
- if (dos != null)
- {
- try
- {
- this._munitionExpendibleID.Marshal(dos);
- this._eventID.Marshal(dos);
- dos.WriteUnsignedInt((uint)this._fireMissionIndex);
- this._locationInWorldCoordinates.Marshal(dos);
- this._descriptor.Marshal(dos);
- this._velocity.Marshal(dos);
- dos.WriteFloat((float)this._range);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Unmarshal(DataInputStream dis)
- {
- base.Unmarshal(dis);
-
- if (dis != null)
- {
- try
- {
- this._munitionExpendibleID.Unmarshal(dis);
- this._eventID.Unmarshal(dis);
- this._fireMissionIndex = dis.ReadUnsignedInt();
- this._locationInWorldCoordinates.Unmarshal(dis);
- this._descriptor.Unmarshal(dis);
- this._velocity.Unmarshal(dis);
- this._range = dis.ReadFloat();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- base.Reflection(sb);
- try
- {
- sb.AppendLine("");
- this._munitionExpendibleID.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- this._eventID.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._fireMissionIndex.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- this._locationInWorldCoordinates.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- this._descriptor.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- this._velocity.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._range.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as FirePdu;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(FirePdu obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- ivarsEqual = base.Equals(obj);
-
- if (!this._munitionExpendibleID.Equals(obj._munitionExpendibleID))
- {
- ivarsEqual = false;
- }
-
- if (!this._eventID.Equals(obj._eventID))
- {
- ivarsEqual = false;
- }
-
- if (this._fireMissionIndex != obj._fireMissionIndex)
- {
- ivarsEqual = false;
- }
-
- if (!this._locationInWorldCoordinates.Equals(obj._locationInWorldCoordinates))
- {
- ivarsEqual = false;
- }
-
- if (!this._descriptor.Equals(obj._descriptor))
- {
- ivarsEqual = false;
- }
-
- if (!this._velocity.Equals(obj._velocity))
- {
- ivarsEqual = false;
- }
-
- if (this._range != obj._range)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ base.GetHashCode();
-
- result = GenerateHash(result) ^ this._munitionExpendibleID.GetHashCode();
- result = GenerateHash(result) ^ this._eventID.GetHashCode();
- result = GenerateHash(result) ^ this._fireMissionIndex.GetHashCode();
- result = GenerateHash(result) ^ this._locationInWorldCoordinates.GetHashCode();
- result = GenerateHash(result) ^ this._descriptor.GetHashCode();
- result = GenerateHash(result) ^ this._velocity.GetHashCode();
- result = GenerateHash(result) ^ this._range.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/FixedDatum.cs b/tests/OpenDisNet.Reference/Generated/FixedDatum.cs
deleted file mode 100644
index 8c840dc..0000000
--- a/tests/OpenDisNet.Reference/Generated/FixedDatum.cs
+++ /dev/null
@@ -1,309 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Fixed Datum Record. Section 6.2.38
- ///
- [Serializable]
- [XmlRoot]
- public partial class FixedDatum
- {
- ///
- /// ID of the fixed datum, an enumeration
- ///
- private uint _fixedDatumID;
-
- ///
- /// Value for the fixed datum
- ///
- private uint _fixedDatumValue;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public FixedDatum()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(FixedDatum left, FixedDatum right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(FixedDatum left, FixedDatum right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += 4; // this._fixedDatumID
- marshalSize += 4; // this._fixedDatumValue
- return marshalSize;
- }
-
- ///
- /// Gets or sets the ID of the fixed datum, an enumeration
- ///
- [XmlElement(Type = typeof(uint), ElementName = "fixedDatumID")]
- public uint FixedDatumID
- {
- get
- {
- return this._fixedDatumID;
- }
-
- set
- {
- this._fixedDatumID = value;
- }
- }
-
- ///
- /// Gets or sets the Value for the fixed datum
- ///
- [XmlElement(Type = typeof(uint), ElementName = "fixedDatumValue")]
- public uint FixedDatumValue
- {
- get
- {
- return this._fixedDatumValue;
- }
-
- set
- {
- this._fixedDatumValue = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedInt((uint)this._fixedDatumID);
- dos.WriteUnsignedInt((uint)this._fixedDatumValue);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._fixedDatumID = dis.ReadUnsignedInt();
- this._fixedDatumValue = dis.ReadUnsignedInt();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("" + this._fixedDatumID.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._fixedDatumValue.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as FixedDatum;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(FixedDatum obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (this._fixedDatumID != obj._fixedDatumID)
- {
- ivarsEqual = false;
- }
-
- if (this._fixedDatumValue != obj._fixedDatumValue)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._fixedDatumID.GetHashCode();
- result = GenerateHash(result) ^ this._fixedDatumValue.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/FourByteChunk.cs b/tests/OpenDisNet.Reference/Generated/FourByteChunk.cs
deleted file mode 100644
index b459c13..0000000
--- a/tests/OpenDisNet.Reference/Generated/FourByteChunk.cs
+++ /dev/null
@@ -1,303 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// 32 bit piece of data
- ///
- [Serializable]
- [XmlRoot]
- public partial class FourByteChunk
- {
- ///
- /// four bytes of arbitrary data
- ///
- private byte[] _otherParameters = new byte[4];
-
- ///
- /// Initializes a new instance of the class.
- ///
- public FourByteChunk()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(FourByteChunk left, FourByteChunk right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(FourByteChunk left, FourByteChunk right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += 4 * 1; // _otherParameters
- return marshalSize;
- }
-
- ///
- /// Gets or sets the four bytes of arbitrary data
- ///
- [XmlArray(ElementName = "otherParameters")]
- public byte[] OtherParameters
- {
- get
- {
- return this._otherParameters;
- }
-
- set
- {
- this._otherParameters = value;
- }
-}
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
-
- for (int idx = 0; idx < this._otherParameters.Length; idx++)
- {
- dos.WriteByte(this._otherParameters[idx]);
- }
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- for (int idx = 0; idx < this._otherParameters.Length; idx++)
- {
- this._otherParameters[idx] = dis.ReadByte();
- }
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- for (int idx = 0; idx < this._otherParameters.Length; idx++)
- {
- sb.AppendLine("" + this._otherParameters[idx] + "");
- }
-
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as FourByteChunk;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(FourByteChunk obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (obj._otherParameters.Length != 4)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < 4; idx++)
- {
- if (this._otherParameters[idx] != obj._otherParameters[idx])
- {
- ivarsEqual = false;
- }
- }
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
-
- for (int idx = 0; idx < 4; idx++)
- {
- result = GenerateHash(result) ^ this._otherParameters[idx].GetHashCode();
- }
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/FundamentalOperationalData.cs b/tests/OpenDisNet.Reference/Generated/FundamentalOperationalData.cs
deleted file mode 100644
index 64f43b3..0000000
--- a/tests/OpenDisNet.Reference/Generated/FundamentalOperationalData.cs
+++ /dev/null
@@ -1,565 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Basic operational data for IFF. Section 6.2.40.
- ///
- [Serializable]
- [XmlRoot]
- public partial class FundamentalOperationalData
- {
- ///
- /// system status
- ///
- private byte _systemStatus;
-
- ///
- /// data field 1
- ///
- private byte _dataField1;
-
- ///
- /// eight boolean fields
- ///
- private byte _informationLayers;
-
- ///
- /// enumeration
- ///
- private byte _dataField2;
-
- ///
- /// parameter, enumeration
- ///
- private ushort _parameter1;
-
- ///
- /// parameter, enumeration
- ///
- private ushort _parameter2;
-
- ///
- /// parameter, enumeration
- ///
- private ushort _parameter3;
-
- ///
- /// parameter, enumeration
- ///
- private ushort _parameter4;
-
- ///
- /// parameter, enumeration
- ///
- private ushort _parameter5;
-
- ///
- /// parameter, enumeration
- ///
- private ushort _parameter6;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public FundamentalOperationalData()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(FundamentalOperationalData left, FundamentalOperationalData right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(FundamentalOperationalData left, FundamentalOperationalData right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += 1; // this._systemStatus
- marshalSize += 1; // this._dataField1
- marshalSize += 1; // this._informationLayers
- marshalSize += 1; // this._dataField2
- marshalSize += 2; // this._parameter1
- marshalSize += 2; // this._parameter2
- marshalSize += 2; // this._parameter3
- marshalSize += 2; // this._parameter4
- marshalSize += 2; // this._parameter5
- marshalSize += 2; // this._parameter6
- return marshalSize;
- }
-
- ///
- /// Gets or sets the system status
- ///
- [XmlElement(Type = typeof(byte), ElementName = "systemStatus")]
- public byte SystemStatus
- {
- get
- {
- return this._systemStatus;
- }
-
- set
- {
- this._systemStatus = value;
- }
- }
-
- ///
- /// Gets or sets the data field 1
- ///
- [XmlElement(Type = typeof(byte), ElementName = "dataField1")]
- public byte DataField1
- {
- get
- {
- return this._dataField1;
- }
-
- set
- {
- this._dataField1 = value;
- }
- }
-
- ///
- /// Gets or sets the eight boolean fields
- ///
- [XmlElement(Type = typeof(byte), ElementName = "informationLayers")]
- public byte InformationLayers
- {
- get
- {
- return this._informationLayers;
- }
-
- set
- {
- this._informationLayers = value;
- }
- }
-
- ///
- /// Gets or sets the enumeration
- ///
- [XmlElement(Type = typeof(byte), ElementName = "dataField2")]
- public byte DataField2
- {
- get
- {
- return this._dataField2;
- }
-
- set
- {
- this._dataField2 = value;
- }
- }
-
- ///
- /// Gets or sets the parameter, enumeration
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "parameter1")]
- public ushort Parameter1
- {
- get
- {
- return this._parameter1;
- }
-
- set
- {
- this._parameter1 = value;
- }
- }
-
- ///
- /// Gets or sets the parameter, enumeration
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "parameter2")]
- public ushort Parameter2
- {
- get
- {
- return this._parameter2;
- }
-
- set
- {
- this._parameter2 = value;
- }
- }
-
- ///
- /// Gets or sets the parameter, enumeration
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "parameter3")]
- public ushort Parameter3
- {
- get
- {
- return this._parameter3;
- }
-
- set
- {
- this._parameter3 = value;
- }
- }
-
- ///
- /// Gets or sets the parameter, enumeration
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "parameter4")]
- public ushort Parameter4
- {
- get
- {
- return this._parameter4;
- }
-
- set
- {
- this._parameter4 = value;
- }
- }
-
- ///
- /// Gets or sets the parameter, enumeration
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "parameter5")]
- public ushort Parameter5
- {
- get
- {
- return this._parameter5;
- }
-
- set
- {
- this._parameter5 = value;
- }
- }
-
- ///
- /// Gets or sets the parameter, enumeration
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "parameter6")]
- public ushort Parameter6
- {
- get
- {
- return this._parameter6;
- }
-
- set
- {
- this._parameter6 = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedByte((byte)this._systemStatus);
- dos.WriteUnsignedByte((byte)this._dataField1);
- dos.WriteUnsignedByte((byte)this._informationLayers);
- dos.WriteUnsignedByte((byte)this._dataField2);
- dos.WriteUnsignedShort((ushort)this._parameter1);
- dos.WriteUnsignedShort((ushort)this._parameter2);
- dos.WriteUnsignedShort((ushort)this._parameter3);
- dos.WriteUnsignedShort((ushort)this._parameter4);
- dos.WriteUnsignedShort((ushort)this._parameter5);
- dos.WriteUnsignedShort((ushort)this._parameter6);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._systemStatus = dis.ReadUnsignedByte();
- this._dataField1 = dis.ReadUnsignedByte();
- this._informationLayers = dis.ReadUnsignedByte();
- this._dataField2 = dis.ReadUnsignedByte();
- this._parameter1 = dis.ReadUnsignedShort();
- this._parameter2 = dis.ReadUnsignedShort();
- this._parameter3 = dis.ReadUnsignedShort();
- this._parameter4 = dis.ReadUnsignedShort();
- this._parameter5 = dis.ReadUnsignedShort();
- this._parameter6 = dis.ReadUnsignedShort();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("" + this._systemStatus.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._dataField1.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._informationLayers.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._dataField2.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._parameter1.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._parameter2.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._parameter3.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._parameter4.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._parameter5.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._parameter6.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as FundamentalOperationalData;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(FundamentalOperationalData obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (this._systemStatus != obj._systemStatus)
- {
- ivarsEqual = false;
- }
-
- if (this._dataField1 != obj._dataField1)
- {
- ivarsEqual = false;
- }
-
- if (this._informationLayers != obj._informationLayers)
- {
- ivarsEqual = false;
- }
-
- if (this._dataField2 != obj._dataField2)
- {
- ivarsEqual = false;
- }
-
- if (this._parameter1 != obj._parameter1)
- {
- ivarsEqual = false;
- }
-
- if (this._parameter2 != obj._parameter2)
- {
- ivarsEqual = false;
- }
-
- if (this._parameter3 != obj._parameter3)
- {
- ivarsEqual = false;
- }
-
- if (this._parameter4 != obj._parameter4)
- {
- ivarsEqual = false;
- }
-
- if (this._parameter5 != obj._parameter5)
- {
- ivarsEqual = false;
- }
-
- if (this._parameter6 != obj._parameter6)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._systemStatus.GetHashCode();
- result = GenerateHash(result) ^ this._dataField1.GetHashCode();
- result = GenerateHash(result) ^ this._informationLayers.GetHashCode();
- result = GenerateHash(result) ^ this._dataField2.GetHashCode();
- result = GenerateHash(result) ^ this._parameter1.GetHashCode();
- result = GenerateHash(result) ^ this._parameter2.GetHashCode();
- result = GenerateHash(result) ^ this._parameter3.GetHashCode();
- result = GenerateHash(result) ^ this._parameter4.GetHashCode();
- result = GenerateHash(result) ^ this._parameter5.GetHashCode();
- result = GenerateHash(result) ^ this._parameter6.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/GridAxis.cs b/tests/OpenDisNet.Reference/Generated/GridAxis.cs
deleted file mode 100644
index 661f51d..0000000
--- a/tests/OpenDisNet.Reference/Generated/GridAxis.cs
+++ /dev/null
@@ -1,469 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Grid axis record for fixed data. Section 6.2.41
- ///
- [Serializable]
- [XmlRoot]
- public partial class GridAxis
- {
- ///
- /// coordinate of the grid origin or initial value
- ///
- private double _domainInitialXi;
-
- ///
- /// coordinate of the endpoint or final value
- ///
- private double _domainFinalXi;
-
- ///
- /// The number of grid points along the Xi domain axis for the enviornmental state data
- ///
- private ushort _domainPointsXi;
-
- ///
- /// interleaf factor along the domain axis.
- ///
- private byte _interleafFactor;
-
- ///
- /// type of grid axis
- ///
- private byte _axisType;
-
- ///
- /// Number of grid locations along Xi axis
- ///
- private ushort _numberOfPointsOnXiAxis;
-
- ///
- /// initial grid point for the current pdu
- ///
- private ushort _initialIndex;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public GridAxis()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(GridAxis left, GridAxis right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(GridAxis left, GridAxis right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += 8; // this._domainInitialXi
- marshalSize += 8; // this._domainFinalXi
- marshalSize += 2; // this._domainPointsXi
- marshalSize += 1; // this._interleafFactor
- marshalSize += 1; // this._axisType
- marshalSize += 2; // this._numberOfPointsOnXiAxis
- marshalSize += 2; // this._initialIndex
- return marshalSize;
- }
-
- ///
- /// Gets or sets the coordinate of the grid origin or initial value
- ///
- [XmlElement(Type = typeof(double), ElementName = "domainInitialXi")]
- public double DomainInitialXi
- {
- get
- {
- return this._domainInitialXi;
- }
-
- set
- {
- this._domainInitialXi = value;
- }
- }
-
- ///
- /// Gets or sets the coordinate of the endpoint or final value
- ///
- [XmlElement(Type = typeof(double), ElementName = "domainFinalXi")]
- public double DomainFinalXi
- {
- get
- {
- return this._domainFinalXi;
- }
-
- set
- {
- this._domainFinalXi = value;
- }
- }
-
- ///
- /// Gets or sets the The number of grid points along the Xi domain axis for the enviornmental state data
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "domainPointsXi")]
- public ushort DomainPointsXi
- {
- get
- {
- return this._domainPointsXi;
- }
-
- set
- {
- this._domainPointsXi = value;
- }
- }
-
- ///
- /// Gets or sets the interleaf factor along the domain axis.
- ///
- [XmlElement(Type = typeof(byte), ElementName = "interleafFactor")]
- public byte InterleafFactor
- {
- get
- {
- return this._interleafFactor;
- }
-
- set
- {
- this._interleafFactor = value;
- }
- }
-
- ///
- /// Gets or sets the type of grid axis
- ///
- [XmlElement(Type = typeof(byte), ElementName = "axisType")]
- public byte AxisType
- {
- get
- {
- return this._axisType;
- }
-
- set
- {
- this._axisType = value;
- }
- }
-
- ///
- /// Gets or sets the Number of grid locations along Xi axis
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "numberOfPointsOnXiAxis")]
- public ushort NumberOfPointsOnXiAxis
- {
- get
- {
- return this._numberOfPointsOnXiAxis;
- }
-
- set
- {
- this._numberOfPointsOnXiAxis = value;
- }
- }
-
- ///
- /// Gets or sets the initial grid point for the current pdu
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "initialIndex")]
- public ushort InitialIndex
- {
- get
- {
- return this._initialIndex;
- }
-
- set
- {
- this._initialIndex = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- dos.WriteDouble((double)this._domainInitialXi);
- dos.WriteDouble((double)this._domainFinalXi);
- dos.WriteUnsignedShort((ushort)this._domainPointsXi);
- dos.WriteUnsignedByte((byte)this._interleafFactor);
- dos.WriteUnsignedByte((byte)this._axisType);
- dos.WriteUnsignedShort((ushort)this._numberOfPointsOnXiAxis);
- dos.WriteUnsignedShort((ushort)this._initialIndex);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._domainInitialXi = dis.ReadDouble();
- this._domainFinalXi = dis.ReadDouble();
- this._domainPointsXi = dis.ReadUnsignedShort();
- this._interleafFactor = dis.ReadUnsignedByte();
- this._axisType = dis.ReadUnsignedByte();
- this._numberOfPointsOnXiAxis = dis.ReadUnsignedShort();
- this._initialIndex = dis.ReadUnsignedShort();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("" + this._domainInitialXi.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._domainFinalXi.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._domainPointsXi.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._interleafFactor.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._axisType.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._numberOfPointsOnXiAxis.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._initialIndex.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as GridAxis;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(GridAxis obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (this._domainInitialXi != obj._domainInitialXi)
- {
- ivarsEqual = false;
- }
-
- if (this._domainFinalXi != obj._domainFinalXi)
- {
- ivarsEqual = false;
- }
-
- if (this._domainPointsXi != obj._domainPointsXi)
- {
- ivarsEqual = false;
- }
-
- if (this._interleafFactor != obj._interleafFactor)
- {
- ivarsEqual = false;
- }
-
- if (this._axisType != obj._axisType)
- {
- ivarsEqual = false;
- }
-
- if (this._numberOfPointsOnXiAxis != obj._numberOfPointsOnXiAxis)
- {
- ivarsEqual = false;
- }
-
- if (this._initialIndex != obj._initialIndex)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._domainInitialXi.GetHashCode();
- result = GenerateHash(result) ^ this._domainFinalXi.GetHashCode();
- result = GenerateHash(result) ^ this._domainPointsXi.GetHashCode();
- result = GenerateHash(result) ^ this._interleafFactor.GetHashCode();
- result = GenerateHash(result) ^ this._axisType.GetHashCode();
- result = GenerateHash(result) ^ this._numberOfPointsOnXiAxis.GetHashCode();
- result = GenerateHash(result) ^ this._initialIndex.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/GroupIdentifier.cs b/tests/OpenDisNet.Reference/Generated/GroupIdentifier.cs
deleted file mode 100644
index 02bc7a2..0000000
--- a/tests/OpenDisNet.Reference/Generated/GroupIdentifier.cs
+++ /dev/null
@@ -1,312 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Unique designation of a group of entities contained in the isGroupOfPdu. Represents a group of entities rather than a single entity. Section 6.2.43
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(EntityType))]
- public partial class GroupIdentifier
- {
- ///
- /// Simulation address (site and application number)
- ///
- private EntityType _simulationAddress = new EntityType();
-
- ///
- /// group number
- ///
- private ushort _groupNumber;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public GroupIdentifier()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(GroupIdentifier left, GroupIdentifier right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(GroupIdentifier left, GroupIdentifier right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += this._simulationAddress.GetMarshalledSize(); // this._simulationAddress
- marshalSize += 2; // this._groupNumber
- return marshalSize;
- }
-
- ///
- /// Gets or sets the Simulation address (site and application number)
- ///
- [XmlElement(Type = typeof(EntityType), ElementName = "simulationAddress")]
- public EntityType SimulationAddress
- {
- get
- {
- return this._simulationAddress;
- }
-
- set
- {
- this._simulationAddress = value;
- }
- }
-
- ///
- /// Gets or sets the group number
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "groupNumber")]
- public ushort GroupNumber
- {
- get
- {
- return this._groupNumber;
- }
-
- set
- {
- this._groupNumber = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- this._simulationAddress.Marshal(dos);
- dos.WriteUnsignedShort((ushort)this._groupNumber);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._simulationAddress.Unmarshal(dis);
- this._groupNumber = dis.ReadUnsignedShort();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("");
- this._simulationAddress.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._groupNumber.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as GroupIdentifier;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(GroupIdentifier obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (!this._simulationAddress.Equals(obj._simulationAddress))
- {
- ivarsEqual = false;
- }
-
- if (this._groupNumber != obj._groupNumber)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._simulationAddress.GetHashCode();
- result = GenerateHash(result) ^ this._groupNumber.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/IFFFundamentalParameterData.cs b/tests/OpenDisNet.Reference/Generated/IFFFundamentalParameterData.cs
deleted file mode 100644
index 05c8e57..0000000
--- a/tests/OpenDisNet.Reference/Generated/IFFFundamentalParameterData.cs
+++ /dev/null
@@ -1,495 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Fundamental IFF atc data. Section 6.2.45
- ///
- [Serializable]
- [XmlRoot]
- public partial class IFFFundamentalParameterData
- {
- ///
- /// ERP
- ///
- private float _erp;
-
- ///
- /// frequency
- ///
- private float _frequency;
-
- ///
- /// pgrf
- ///
- private float _pgrf;
-
- ///
- /// Pulse width
- ///
- private float _pulseWidth;
-
- ///
- /// Burst length
- ///
- private uint _burstLength;
-
- ///
- /// Applicable modes enumeration
- ///
- private byte _applicableModes;
-
- ///
- /// System-specific data
- ///
- private byte[] _systemSpecificData = new byte[3];
-
- ///
- /// Initializes a new instance of the class.
- ///
- public IFFFundamentalParameterData()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(IFFFundamentalParameterData left, IFFFundamentalParameterData right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(IFFFundamentalParameterData left, IFFFundamentalParameterData right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += 4; // this._erp
- marshalSize += 4; // this._frequency
- marshalSize += 4; // this._pgrf
- marshalSize += 4; // this._pulseWidth
- marshalSize += 4; // this._burstLength
- marshalSize += 1; // this._applicableModes
- marshalSize += 3 * 1; // _systemSpecificData
- return marshalSize;
- }
-
- ///
- /// Gets or sets the ERP
- ///
- [XmlElement(Type = typeof(float), ElementName = "erp")]
- public float Erp
- {
- get
- {
- return this._erp;
- }
-
- set
- {
- this._erp = value;
- }
- }
-
- ///
- /// Gets or sets the frequency
- ///
- [XmlElement(Type = typeof(float), ElementName = "frequency")]
- public float Frequency
- {
- get
- {
- return this._frequency;
- }
-
- set
- {
- this._frequency = value;
- }
- }
-
- ///
- /// Gets or sets the pgrf
- ///
- [XmlElement(Type = typeof(float), ElementName = "pgrf")]
- public float Pgrf
- {
- get
- {
- return this._pgrf;
- }
-
- set
- {
- this._pgrf = value;
- }
- }
-
- ///
- /// Gets or sets the Pulse width
- ///
- [XmlElement(Type = typeof(float), ElementName = "pulseWidth")]
- public float PulseWidth
- {
- get
- {
- return this._pulseWidth;
- }
-
- set
- {
- this._pulseWidth = value;
- }
- }
-
- ///
- /// Gets or sets the Burst length
- ///
- [XmlElement(Type = typeof(uint), ElementName = "burstLength")]
- public uint BurstLength
- {
- get
- {
- return this._burstLength;
- }
-
- set
- {
- this._burstLength = value;
- }
- }
-
- ///
- /// Gets or sets the Applicable modes enumeration
- ///
- [XmlElement(Type = typeof(byte), ElementName = "applicableModes")]
- public byte ApplicableModes
- {
- get
- {
- return this._applicableModes;
- }
-
- set
- {
- this._applicableModes = value;
- }
- }
-
- ///
- /// Gets or sets the System-specific data
- ///
- [XmlArray(ElementName = "systemSpecificData")]
- public byte[] SystemSpecificData
- {
- get
- {
- return this._systemSpecificData;
- }
-
- set
- {
- this._systemSpecificData = value;
- }
-}
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- dos.WriteFloat((float)this._erp);
- dos.WriteFloat((float)this._frequency);
- dos.WriteFloat((float)this._pgrf);
- dos.WriteFloat((float)this._pulseWidth);
- dos.WriteUnsignedInt((uint)this._burstLength);
- dos.WriteUnsignedByte((byte)this._applicableModes);
-
- for (int idx = 0; idx < this._systemSpecificData.Length; idx++)
- {
- dos.WriteUnsignedByte(this._systemSpecificData[idx]);
- }
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._erp = dis.ReadFloat();
- this._frequency = dis.ReadFloat();
- this._pgrf = dis.ReadFloat();
- this._pulseWidth = dis.ReadFloat();
- this._burstLength = dis.ReadUnsignedInt();
- this._applicableModes = dis.ReadUnsignedByte();
- for (int idx = 0; idx < this._systemSpecificData.Length; idx++)
- {
- this._systemSpecificData[idx] = dis.ReadUnsignedByte();
- }
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("" + this._erp.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._frequency.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._pgrf.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._pulseWidth.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._burstLength.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._applicableModes.ToString(CultureInfo.InvariantCulture) + "");
- for (int idx = 0; idx < this._systemSpecificData.Length; idx++)
- {
- sb.AppendLine("" + this._systemSpecificData[idx] + "");
- }
-
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as IFFFundamentalParameterData;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(IFFFundamentalParameterData obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (this._erp != obj._erp)
- {
- ivarsEqual = false;
- }
-
- if (this._frequency != obj._frequency)
- {
- ivarsEqual = false;
- }
-
- if (this._pgrf != obj._pgrf)
- {
- ivarsEqual = false;
- }
-
- if (this._pulseWidth != obj._pulseWidth)
- {
- ivarsEqual = false;
- }
-
- if (this._burstLength != obj._burstLength)
- {
- ivarsEqual = false;
- }
-
- if (this._applicableModes != obj._applicableModes)
- {
- ivarsEqual = false;
- }
-
- if (obj._systemSpecificData.Length != 3)
- {
- ivarsEqual = false;
- }
-
- if (ivarsEqual)
- {
- for (int idx = 0; idx < 3; idx++)
- {
- if (this._systemSpecificData[idx] != obj._systemSpecificData[idx])
- {
- ivarsEqual = false;
- }
- }
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._erp.GetHashCode();
- result = GenerateHash(result) ^ this._frequency.GetHashCode();
- result = GenerateHash(result) ^ this._pgrf.GetHashCode();
- result = GenerateHash(result) ^ this._pulseWidth.GetHashCode();
- result = GenerateHash(result) ^ this._burstLength.GetHashCode();
- result = GenerateHash(result) ^ this._applicableModes.GetHashCode();
-
- for (int idx = 0; idx < 3; idx++)
- {
- result = GenerateHash(result) ^ this._systemSpecificData[idx].GetHashCode();
- }
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/IOCommunicationsNode.cs b/tests/OpenDisNet.Reference/Generated/IOCommunicationsNode.cs
deleted file mode 100644
index 9fcd7c4..0000000
--- a/tests/OpenDisNet.Reference/Generated/IOCommunicationsNode.cs
+++ /dev/null
@@ -1,404 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// A communications node that is part of a simulted communcations network. Section 6.2.49.2
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(EntityID))]
- public partial class IOCommunicationsNode
- {
- private uint _recordType = 5501;
-
- private ushort _recordLength = 16;
-
- private byte _communcationsNodeType;
-
- private byte _padding;
-
- private EntityID _communicationsNode = new EntityID();
-
- private ushort _elementID;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public IOCommunicationsNode()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(IOCommunicationsNode left, IOCommunicationsNode right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(IOCommunicationsNode left, IOCommunicationsNode right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += 4; // this._recordType
- marshalSize += 2; // this._recordLength
- marshalSize += 1; // this._communcationsNodeType
- marshalSize += 1; // this._padding
- marshalSize += this._communicationsNode.GetMarshalledSize(); // this._communicationsNode
- marshalSize += 2; // this._elementID
- return marshalSize;
- }
-
- [XmlElement(Type = typeof(uint), ElementName = "recordType")]
- public uint RecordType
- {
- get
- {
- return this._recordType;
- }
-
- set
- {
- this._recordType = value;
- }
- }
-
- [XmlElement(Type = typeof(ushort), ElementName = "recordLength")]
- public ushort RecordLength
- {
- get
- {
- return this._recordLength;
- }
-
- set
- {
- this._recordLength = value;
- }
- }
-
- [XmlElement(Type = typeof(byte), ElementName = "communcationsNodeType")]
- public byte CommuncationsNodeType
- {
- get
- {
- return this._communcationsNodeType;
- }
-
- set
- {
- this._communcationsNodeType = value;
- }
- }
-
- [XmlElement(Type = typeof(byte), ElementName = "padding")]
- public byte Padding
- {
- get
- {
- return this._padding;
- }
-
- set
- {
- this._padding = value;
- }
- }
-
- [XmlElement(Type = typeof(EntityID), ElementName = "communicationsNode")]
- public EntityID CommunicationsNode
- {
- get
- {
- return this._communicationsNode;
- }
-
- set
- {
- this._communicationsNode = value;
- }
- }
-
- [XmlElement(Type = typeof(ushort), ElementName = "elementID")]
- public ushort ElementID
- {
- get
- {
- return this._elementID;
- }
-
- set
- {
- this._elementID = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedInt((uint)this._recordType);
- dos.WriteUnsignedShort((ushort)this._recordLength);
- dos.WriteUnsignedByte((byte)this._communcationsNodeType);
- dos.WriteUnsignedByte((byte)this._padding);
- this._communicationsNode.Marshal(dos);
- dos.WriteUnsignedShort((ushort)this._elementID);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._recordType = dis.ReadUnsignedInt();
- this._recordLength = dis.ReadUnsignedShort();
- this._communcationsNodeType = dis.ReadUnsignedByte();
- this._padding = dis.ReadUnsignedByte();
- this._communicationsNode.Unmarshal(dis);
- this._elementID = dis.ReadUnsignedShort();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("" + this._recordType.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._recordLength.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._communcationsNodeType.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._padding.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- this._communicationsNode.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._elementID.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as IOCommunicationsNode;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(IOCommunicationsNode obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (this._recordType != obj._recordType)
- {
- ivarsEqual = false;
- }
-
- if (this._recordLength != obj._recordLength)
- {
- ivarsEqual = false;
- }
-
- if (this._communcationsNodeType != obj._communcationsNodeType)
- {
- ivarsEqual = false;
- }
-
- if (this._padding != obj._padding)
- {
- ivarsEqual = false;
- }
-
- if (!this._communicationsNode.Equals(obj._communicationsNode))
- {
- ivarsEqual = false;
- }
-
- if (this._elementID != obj._elementID)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._recordType.GetHashCode();
- result = GenerateHash(result) ^ this._recordLength.GetHashCode();
- result = GenerateHash(result) ^ this._communcationsNodeType.GetHashCode();
- result = GenerateHash(result) ^ this._padding.GetHashCode();
- result = GenerateHash(result) ^ this._communicationsNode.GetHashCode();
- result = GenerateHash(result) ^ this._elementID.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/IOEffect.cs b/tests/OpenDisNet.Reference/Generated/IOEffect.cs
deleted file mode 100644
index 326dd68..0000000
--- a/tests/OpenDisNet.Reference/Generated/IOEffect.cs
+++ /dev/null
@@ -1,482 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Effect of IO on an entity. Section 6.2.49.3
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(EntityID))]
- public partial class IOEffect
- {
- private uint _recordType = 5500;
-
- private ushort _recordLength = 16;
-
- private byte _ioStatus;
-
- private byte _ioLinkType;
-
- private EntityID _ioEffect = new EntityID();
-
- private byte _ioEffectDutyCycle;
-
- private ushort _ioEffectDuration;
-
- private ushort _ioProcess;
-
- private ushort _padding;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public IOEffect()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(IOEffect left, IOEffect right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(IOEffect left, IOEffect right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += 4; // this._recordType
- marshalSize += 2; // this._recordLength
- marshalSize += 1; // this._ioStatus
- marshalSize += 1; // this._ioLinkType
- marshalSize += this._ioEffect.GetMarshalledSize(); // this._ioEffect
- marshalSize += 1; // this._ioEffectDutyCycle
- marshalSize += 2; // this._ioEffectDuration
- marshalSize += 2; // this._ioProcess
- marshalSize += 2; // this._padding
- return marshalSize;
- }
-
- [XmlElement(Type = typeof(uint), ElementName = "recordType")]
- public uint RecordType
- {
- get
- {
- return this._recordType;
- }
-
- set
- {
- this._recordType = value;
- }
- }
-
- [XmlElement(Type = typeof(ushort), ElementName = "recordLength")]
- public ushort RecordLength
- {
- get
- {
- return this._recordLength;
- }
-
- set
- {
- this._recordLength = value;
- }
- }
-
- [XmlElement(Type = typeof(byte), ElementName = "ioStatus")]
- public byte IoStatus
- {
- get
- {
- return this._ioStatus;
- }
-
- set
- {
- this._ioStatus = value;
- }
- }
-
- [XmlElement(Type = typeof(byte), ElementName = "ioLinkType")]
- public byte IoLinkType
- {
- get
- {
- return this._ioLinkType;
- }
-
- set
- {
- this._ioLinkType = value;
- }
- }
-
- [XmlElement(Type = typeof(EntityID), ElementName = "ioEffect")]
- public EntityID IoEffect
- {
- get
- {
- return this._ioEffect;
- }
-
- set
- {
- this._ioEffect = value;
- }
- }
-
- [XmlElement(Type = typeof(byte), ElementName = "ioEffectDutyCycle")]
- public byte IoEffectDutyCycle
- {
- get
- {
- return this._ioEffectDutyCycle;
- }
-
- set
- {
- this._ioEffectDutyCycle = value;
- }
- }
-
- [XmlElement(Type = typeof(ushort), ElementName = "ioEffectDuration")]
- public ushort IoEffectDuration
- {
- get
- {
- return this._ioEffectDuration;
- }
-
- set
- {
- this._ioEffectDuration = value;
- }
- }
-
- [XmlElement(Type = typeof(ushort), ElementName = "ioProcess")]
- public ushort IoProcess
- {
- get
- {
- return this._ioProcess;
- }
-
- set
- {
- this._ioProcess = value;
- }
- }
-
- [XmlElement(Type = typeof(ushort), ElementName = "padding")]
- public ushort Padding
- {
- get
- {
- return this._padding;
- }
-
- set
- {
- this._padding = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedInt((uint)this._recordType);
- dos.WriteUnsignedShort((ushort)this._recordLength);
- dos.WriteUnsignedByte((byte)this._ioStatus);
- dos.WriteUnsignedByte((byte)this._ioLinkType);
- this._ioEffect.Marshal(dos);
- dos.WriteUnsignedByte((byte)this._ioEffectDutyCycle);
- dos.WriteUnsignedShort((ushort)this._ioEffectDuration);
- dos.WriteUnsignedShort((ushort)this._ioProcess);
- dos.WriteUnsignedShort((ushort)this._padding);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._recordType = dis.ReadUnsignedInt();
- this._recordLength = dis.ReadUnsignedShort();
- this._ioStatus = dis.ReadUnsignedByte();
- this._ioLinkType = dis.ReadUnsignedByte();
- this._ioEffect.Unmarshal(dis);
- this._ioEffectDutyCycle = dis.ReadUnsignedByte();
- this._ioEffectDuration = dis.ReadUnsignedShort();
- this._ioProcess = dis.ReadUnsignedShort();
- this._padding = dis.ReadUnsignedShort();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("" + this._recordType.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._recordLength.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._ioStatus.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._ioLinkType.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- this._ioEffect.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._ioEffectDutyCycle.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._ioEffectDuration.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._ioProcess.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._padding.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as IOEffect;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(IOEffect obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (this._recordType != obj._recordType)
- {
- ivarsEqual = false;
- }
-
- if (this._recordLength != obj._recordLength)
- {
- ivarsEqual = false;
- }
-
- if (this._ioStatus != obj._ioStatus)
- {
- ivarsEqual = false;
- }
-
- if (this._ioLinkType != obj._ioLinkType)
- {
- ivarsEqual = false;
- }
-
- if (!this._ioEffect.Equals(obj._ioEffect))
- {
- ivarsEqual = false;
- }
-
- if (this._ioEffectDutyCycle != obj._ioEffectDutyCycle)
- {
- ivarsEqual = false;
- }
-
- if (this._ioEffectDuration != obj._ioEffectDuration)
- {
- ivarsEqual = false;
- }
-
- if (this._ioProcess != obj._ioProcess)
- {
- ivarsEqual = false;
- }
-
- if (this._padding != obj._padding)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._recordType.GetHashCode();
- result = GenerateHash(result) ^ this._recordLength.GetHashCode();
- result = GenerateHash(result) ^ this._ioStatus.GetHashCode();
- result = GenerateHash(result) ^ this._ioLinkType.GetHashCode();
- result = GenerateHash(result) ^ this._ioEffect.GetHashCode();
- result = GenerateHash(result) ^ this._ioEffectDutyCycle.GetHashCode();
- result = GenerateHash(result) ^ this._ioEffectDuration.GetHashCode();
- result = GenerateHash(result) ^ this._ioProcess.GetHashCode();
- result = GenerateHash(result) ^ this._padding.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/IffDataSpecification.cs b/tests/OpenDisNet.Reference/Generated/IffDataSpecification.cs
deleted file mode 100644
index 74e753d..0000000
--- a/tests/OpenDisNet.Reference/Generated/IffDataSpecification.cs
+++ /dev/null
@@ -1,280 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Requires hand coding to be useful. Section 6.2.44
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(EntityType))]
- public partial class IffDataSpecification
- {
- ///
- /// Number of iff records
- ///
- private EntityType _numberOfIffDataRecords = new EntityType();
-
- ///
- /// Initializes a new instance of the class.
- ///
- public IffDataSpecification()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(IffDataSpecification left, IffDataSpecification right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(IffDataSpecification left, IffDataSpecification right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += this._numberOfIffDataRecords.GetMarshalledSize(); // this._numberOfIffDataRecords
- return marshalSize;
- }
-
- ///
- /// Gets or sets the Number of iff records
- ///
- [XmlElement(Type = typeof(EntityType), ElementName = "numberOfIffDataRecords")]
- public EntityType NumberOfIffDataRecords
- {
- get
- {
- return this._numberOfIffDataRecords;
- }
-
- set
- {
- this._numberOfIffDataRecords = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- this._numberOfIffDataRecords.Marshal(dos);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._numberOfIffDataRecords.Unmarshal(dis);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("");
- this._numberOfIffDataRecords.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as IffDataSpecification;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(IffDataSpecification obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (!this._numberOfIffDataRecords.Equals(obj._numberOfIffDataRecords))
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._numberOfIffDataRecords.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/IntercomCommunicationsParameters.cs b/tests/OpenDisNet.Reference/Generated/IntercomCommunicationsParameters.cs
deleted file mode 100644
index bfb68d8..0000000
--- a/tests/OpenDisNet.Reference/Generated/IntercomCommunicationsParameters.cs
+++ /dev/null
@@ -1,341 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Intercom communcations parameters. Section 6.2.47. This requires hand coding
- ///
- [Serializable]
- [XmlRoot]
- public partial class IntercomCommunicationsParameters
- {
- ///
- /// Type of intercom parameters record
- ///
- private ushort _recordType;
-
- ///
- /// length of record
- ///
- private ushort _recordLength;
-
- ///
- /// This is a placeholder.
- ///
- private uint _recordSpecificField;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public IntercomCommunicationsParameters()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(IntercomCommunicationsParameters left, IntercomCommunicationsParameters right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(IntercomCommunicationsParameters left, IntercomCommunicationsParameters right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += 2; // this._recordType
- marshalSize += 2; // this._recordLength
- marshalSize += 4; // this._recordSpecificField
- return marshalSize;
- }
-
- ///
- /// Gets or sets the Type of intercom parameters record
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "recordType")]
- public ushort RecordType
- {
- get
- {
- return this._recordType;
- }
-
- set
- {
- this._recordType = value;
- }
- }
-
- ///
- /// Gets or sets the length of record
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "recordLength")]
- public ushort RecordLength
- {
- get
- {
- return this._recordLength;
- }
-
- set
- {
- this._recordLength = value;
- }
- }
-
- ///
- /// Gets or sets the This is a placeholder.
- ///
- [XmlElement(Type = typeof(uint), ElementName = "recordSpecificField")]
- public uint RecordSpecificField
- {
- get
- {
- return this._recordSpecificField;
- }
-
- set
- {
- this._recordSpecificField = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedShort((ushort)this._recordType);
- dos.WriteUnsignedShort((ushort)this._recordLength);
- dos.WriteUnsignedInt((uint)this._recordSpecificField);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._recordType = dis.ReadUnsignedShort();
- this._recordLength = dis.ReadUnsignedShort();
- this._recordSpecificField = dis.ReadUnsignedInt();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("" + this._recordType.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._recordLength.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._recordSpecificField.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as IntercomCommunicationsParameters;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(IntercomCommunicationsParameters obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (this._recordType != obj._recordType)
- {
- ivarsEqual = false;
- }
-
- if (this._recordLength != obj._recordLength)
- {
- ivarsEqual = false;
- }
-
- if (this._recordSpecificField != obj._recordSpecificField)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._recordType.GetHashCode();
- result = GenerateHash(result) ^ this._recordLength.GetHashCode();
- result = GenerateHash(result) ^ this._recordSpecificField.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/IntercomIdentifier.cs b/tests/OpenDisNet.Reference/Generated/IntercomIdentifier.cs
deleted file mode 100644
index 68a1a3b..0000000
--- a/tests/OpenDisNet.Reference/Generated/IntercomIdentifier.cs
+++ /dev/null
@@ -1,349 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Unique designation of an attached or unattached intercom in an event or exercirse. Section 6.2.48
- ///
- [Serializable]
- [XmlRoot]
- public partial class IntercomIdentifier
- {
- private ushort _siteNumber;
-
- private ushort _applicationNumber;
-
- private ushort _referenceNumber;
-
- private ushort _intercomNumber;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public IntercomIdentifier()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(IntercomIdentifier left, IntercomIdentifier right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(IntercomIdentifier left, IntercomIdentifier right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += 2; // this._siteNumber
- marshalSize += 2; // this._applicationNumber
- marshalSize += 2; // this._referenceNumber
- marshalSize += 2; // this._intercomNumber
- return marshalSize;
- }
-
- [XmlElement(Type = typeof(ushort), ElementName = "siteNumber")]
- public ushort SiteNumber
- {
- get
- {
- return this._siteNumber;
- }
-
- set
- {
- this._siteNumber = value;
- }
- }
-
- [XmlElement(Type = typeof(ushort), ElementName = "applicationNumber")]
- public ushort ApplicationNumber
- {
- get
- {
- return this._applicationNumber;
- }
-
- set
- {
- this._applicationNumber = value;
- }
- }
-
- [XmlElement(Type = typeof(ushort), ElementName = "referenceNumber")]
- public ushort ReferenceNumber
- {
- get
- {
- return this._referenceNumber;
- }
-
- set
- {
- this._referenceNumber = value;
- }
- }
-
- [XmlElement(Type = typeof(ushort), ElementName = "intercomNumber")]
- public ushort IntercomNumber
- {
- get
- {
- return this._intercomNumber;
- }
-
- set
- {
- this._intercomNumber = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedShort((ushort)this._siteNumber);
- dos.WriteUnsignedShort((ushort)this._applicationNumber);
- dos.WriteUnsignedShort((ushort)this._referenceNumber);
- dos.WriteUnsignedShort((ushort)this._intercomNumber);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._siteNumber = dis.ReadUnsignedShort();
- this._applicationNumber = dis.ReadUnsignedShort();
- this._referenceNumber = dis.ReadUnsignedShort();
- this._intercomNumber = dis.ReadUnsignedShort();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("" + this._siteNumber.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._applicationNumber.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._referenceNumber.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._intercomNumber.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as IntercomIdentifier;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(IntercomIdentifier obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (this._siteNumber != obj._siteNumber)
- {
- ivarsEqual = false;
- }
-
- if (this._applicationNumber != obj._applicationNumber)
- {
- ivarsEqual = false;
- }
-
- if (this._referenceNumber != obj._referenceNumber)
- {
- ivarsEqual = false;
- }
-
- if (this._intercomNumber != obj._intercomNumber)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._siteNumber.GetHashCode();
- result = GenerateHash(result) ^ this._applicationNumber.GetHashCode();
- result = GenerateHash(result) ^ this._referenceNumber.GetHashCode();
- result = GenerateHash(result) ^ this._intercomNumber.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/IntercomSignalPdu.cs b/tests/OpenDisNet.Reference/Generated/IntercomSignalPdu.cs
deleted file mode 100644
index e4e952e..0000000
--- a/tests/OpenDisNet.Reference/Generated/IntercomSignalPdu.cs
+++ /dev/null
@@ -1,525 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Actual transmission of intercome voice data. Section 7.7.5. COMPLETE
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(EntityID))]
- [XmlInclude(typeof(OneByteChunk))]
- public partial class IntercomSignalPdu : RadioCommunicationsFamilyPdu, IEquatable
- {
- ///
- /// entity ID
- ///
- private EntityID _entityID = new EntityID();
-
- ///
- /// ID of communications device
- ///
- private ushort _communicationsDeviceID;
-
- ///
- /// encoding scheme
- ///
- private ushort _encodingScheme;
-
- ///
- /// tactical data link type
- ///
- private ushort _tdlType;
-
- ///
- /// sample rate
- ///
- private uint _sampleRate;
-
- ///
- /// data length
- ///
- private ushort _dataLength;
-
- ///
- /// samples
- ///
- private ushort _samples;
-
- ///
- /// data bytes
- ///
- private byte[] _data;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public IntercomSignalPdu()
- {
- PduType = (byte)31;
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(IntercomSignalPdu left, IntercomSignalPdu right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(IntercomSignalPdu left, IntercomSignalPdu right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public override int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize = base.GetMarshalledSize();
- marshalSize += this._entityID.GetMarshalledSize(); // this._entityID
- marshalSize += 2; // this._communicationsDeviceID
- marshalSize += 2; // this._encodingScheme
- marshalSize += 2; // this._tdlType
- marshalSize += 4; // this._sampleRate
- marshalSize += 2; // this._dataLength
- marshalSize += 2; // this._samples
- marshalSize += this._data.Length;
- return marshalSize;
- }
-
- ///
- /// Gets or sets the entity ID
- ///
- [XmlElement(Type = typeof(EntityID), ElementName = "entityID")]
- public EntityID EntityID
- {
- get
- {
- return this._entityID;
- }
-
- set
- {
- this._entityID = value;
- }
- }
-
- ///
- /// Gets or sets the ID of communications device
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "communicationsDeviceID")]
- public ushort CommunicationsDeviceID
- {
- get
- {
- return this._communicationsDeviceID;
- }
-
- set
- {
- this._communicationsDeviceID = value;
- }
- }
-
- ///
- /// Gets or sets the encoding scheme
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "encodingScheme")]
- public ushort EncodingScheme
- {
- get
- {
- return this._encodingScheme;
- }
-
- set
- {
- this._encodingScheme = value;
- }
- }
-
- ///
- /// Gets or sets the tactical data link type
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "tdlType")]
- public ushort TdlType
- {
- get
- {
- return this._tdlType;
- }
-
- set
- {
- this._tdlType = value;
- }
- }
-
- ///
- /// Gets or sets the sample rate
- ///
- [XmlElement(Type = typeof(uint), ElementName = "sampleRate")]
- public uint SampleRate
- {
- get
- {
- return this._sampleRate;
- }
-
- set
- {
- this._sampleRate = value;
- }
- }
-
- ///
- /// Note that setting this value will not change the marshalled value. The list whose length this describes is used for that purpose.
- /// The getdataLength method will also be based on the actual list length rather than this value.
- /// The method is simply here for completeness and should not be used for any computations.
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "dataLength")]
- public ushort DataLength
- {
- get
- {
- return this._dataLength;
- }
-
- set
- {
- this._dataLength = value;
- }
- }
-
- ///
- /// Gets or sets the samples
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "samples")]
- public ushort Samples
- {
- get
- {
- return this._samples;
- }
-
- set
- {
- this._samples = value;
- }
- }
-
- ///
- /// Gets or sets the data bytes
- ///
- [XmlElement(ElementName = "dataList", DataType = "hexBinary")]
- public byte[] Data
- {
- get
- {
- return this._data;
- }
-
- set
- {
- this._data = value;
- }
- }
-
- ///
- /// Automatically sets the length of the marshalled data, then calls the marshal method.
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- public override void MarshalAutoLengthSet(DataOutputStream dos)
- {
- // Set the length prior to marshalling data
- this.Length = (ushort)this.GetMarshalledSize();
- this.Marshal(dos);
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Marshal(DataOutputStream dos)
- {
- base.Marshal(dos);
- if (dos != null)
- {
- try
- {
- this._entityID.Marshal(dos);
- dos.WriteUnsignedShort((ushort)this._communicationsDeviceID);
- dos.WriteUnsignedShort((ushort)this._encodingScheme);
- dos.WriteUnsignedShort((ushort)this._tdlType);
- dos.WriteUnsignedInt((uint)this._sampleRate);
- dos.WriteUnsignedShort((ushort)this._data.Length);
- dos.WriteUnsignedShort((ushort)this._samples);
- dos.WriteByte (this._data);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Unmarshal(DataInputStream dis)
- {
- base.Unmarshal(dis);
-
- if (dis != null)
- {
- try
- {
- this._entityID.Unmarshal(dis);
- this._communicationsDeviceID = dis.ReadUnsignedShort();
- this._encodingScheme = dis.ReadUnsignedShort();
- this._tdlType = dis.ReadUnsignedShort();
- this._sampleRate = dis.ReadUnsignedInt();
- this._dataLength = dis.ReadUnsignedShort();
- this._samples = dis.ReadUnsignedShort();
- this._data = dis.ReadByteArray(this._dataLength);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- base.Reflection(sb);
- try
- {
- sb.AppendLine("");
- this._entityID.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._communicationsDeviceID.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._encodingScheme.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._tdlType.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._sampleRate.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._data.Length.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._samples.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- foreach (byte b in this._data)
- {
- sb.Append(b.ToString("X2", CultureInfo.InvariantCulture));
- }
-
- sb.AppendLine("");
-
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as IntercomSignalPdu;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(IntercomSignalPdu obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- ivarsEqual = base.Equals(obj);
-
- if (!this._entityID.Equals(obj._entityID))
- {
- ivarsEqual = false;
- }
-
- if (this._communicationsDeviceID != obj._communicationsDeviceID)
- {
- ivarsEqual = false;
- }
-
- if (this._encodingScheme != obj._encodingScheme)
- {
- ivarsEqual = false;
- }
-
- if (this._tdlType != obj._tdlType)
- {
- ivarsEqual = false;
- }
-
- if (this._sampleRate != obj._sampleRate)
- {
- ivarsEqual = false;
- }
-
- if (this._dataLength != obj._dataLength)
- {
- ivarsEqual = false;
- }
-
- if (this._samples != obj._samples)
- {
- ivarsEqual = false;
- }
-
- if (!this._data.Equals(obj._data))
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ base.GetHashCode();
-
- result = GenerateHash(result) ^ this._entityID.GetHashCode();
- result = GenerateHash(result) ^ this._communicationsDeviceID.GetHashCode();
- result = GenerateHash(result) ^ this._encodingScheme.GetHashCode();
- result = GenerateHash(result) ^ this._tdlType.GetHashCode();
- result = GenerateHash(result) ^ this._sampleRate.GetHashCode();
- result = GenerateHash(result) ^ this._dataLength.GetHashCode();
- result = GenerateHash(result) ^ this._samples.GetHashCode();
-
- if (this._data.Length > 0)
- {
- for (int idx = 0; idx < this._data.Length; idx++)
- {
- result = GenerateHash(result) ^ this._data[idx].GetHashCode();
- }
- }
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/IsPartOfPdu.cs b/tests/OpenDisNet.Reference/Generated/IsPartOfPdu.cs
deleted file mode 100644
index de30790..0000000
--- a/tests/OpenDisNet.Reference/Generated/IsPartOfPdu.cs
+++ /dev/null
@@ -1,458 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// The joining of two or more simulation entities is communicated by this PDU. Section 7.8.5 COMPLETE
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(EntityID))]
- [XmlInclude(typeof(Relationship))]
- [XmlInclude(typeof(Vector3Float))]
- [XmlInclude(typeof(NamedLocationIdentification))]
- [XmlInclude(typeof(EntityType))]
- public partial class IsPartOfPdu : EntityManagementFamilyPdu, IEquatable
- {
- ///
- /// ID of entity originating PDU
- ///
- private EntityID _orginatingEntityID = new EntityID();
-
- ///
- /// ID of entity receiving PDU
- ///
- private EntityID _receivingEntityID = new EntityID();
-
- ///
- /// relationship of joined parts
- ///
- private Relationship _relationship = new Relationship();
-
- ///
- /// location of part; centroid of part in host's coordinate system. x=range, y=bearing, z=0
- ///
- private Vector3Float _partLocation = new Vector3Float();
-
- ///
- /// named location
- ///
- private NamedLocationIdentification _namedLocationID = new NamedLocationIdentification();
-
- ///
- /// entity type
- ///
- private EntityType _partEntityType = new EntityType();
-
- ///
- /// Initializes a new instance of the class.
- ///
- public IsPartOfPdu()
- {
- PduType = (byte)36;
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(IsPartOfPdu left, IsPartOfPdu right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(IsPartOfPdu left, IsPartOfPdu right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public override int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize = base.GetMarshalledSize();
- marshalSize += this._orginatingEntityID.GetMarshalledSize(); // this._orginatingEntityID
- marshalSize += this._receivingEntityID.GetMarshalledSize(); // this._receivingEntityID
- marshalSize += this._relationship.GetMarshalledSize(); // this._relationship
- marshalSize += this._partLocation.GetMarshalledSize(); // this._partLocation
- marshalSize += this._namedLocationID.GetMarshalledSize(); // this._namedLocationID
- marshalSize += this._partEntityType.GetMarshalledSize(); // this._partEntityType
- return marshalSize;
- }
-
- ///
- /// Gets or sets the ID of entity originating PDU
- ///
- [XmlElement(Type = typeof(EntityID), ElementName = "orginatingEntityID")]
- public EntityID OrginatingEntityID
- {
- get
- {
- return this._orginatingEntityID;
- }
-
- set
- {
- this._orginatingEntityID = value;
- }
- }
-
- ///
- /// Gets or sets the ID of entity receiving PDU
- ///
- [XmlElement(Type = typeof(EntityID), ElementName = "receivingEntityID")]
- public EntityID ReceivingEntityID
- {
- get
- {
- return this._receivingEntityID;
- }
-
- set
- {
- this._receivingEntityID = value;
- }
- }
-
- ///
- /// Gets or sets the relationship of joined parts
- ///
- [XmlElement(Type = typeof(Relationship), ElementName = "relationship")]
- public Relationship Relationship
- {
- get
- {
- return this._relationship;
- }
-
- set
- {
- this._relationship = value;
- }
- }
-
- ///
- /// Gets or sets the location of part; centroid of part in host's coordinate system. x=range, y=bearing, z=0
- ///
- [XmlElement(Type = typeof(Vector3Float), ElementName = "partLocation")]
- public Vector3Float PartLocation
- {
- get
- {
- return this._partLocation;
- }
-
- set
- {
- this._partLocation = value;
- }
- }
-
- ///
- /// Gets or sets the named location
- ///
- [XmlElement(Type = typeof(NamedLocationIdentification), ElementName = "namedLocationID")]
- public NamedLocationIdentification NamedLocationID
- {
- get
- {
- return this._namedLocationID;
- }
-
- set
- {
- this._namedLocationID = value;
- }
- }
-
- ///
- /// Gets or sets the entity type
- ///
- [XmlElement(Type = typeof(EntityType), ElementName = "partEntityType")]
- public EntityType PartEntityType
- {
- get
- {
- return this._partEntityType;
- }
-
- set
- {
- this._partEntityType = value;
- }
- }
-
- ///
- /// Automatically sets the length of the marshalled data, then calls the marshal method.
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- public override void MarshalAutoLengthSet(DataOutputStream dos)
- {
- // Set the length prior to marshalling data
- this.Length = (ushort)this.GetMarshalledSize();
- this.Marshal(dos);
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Marshal(DataOutputStream dos)
- {
- base.Marshal(dos);
- if (dos != null)
- {
- try
- {
- this._orginatingEntityID.Marshal(dos);
- this._receivingEntityID.Marshal(dos);
- this._relationship.Marshal(dos);
- this._partLocation.Marshal(dos);
- this._namedLocationID.Marshal(dos);
- this._partEntityType.Marshal(dos);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Unmarshal(DataInputStream dis)
- {
- base.Unmarshal(dis);
-
- if (dis != null)
- {
- try
- {
- this._orginatingEntityID.Unmarshal(dis);
- this._receivingEntityID.Unmarshal(dis);
- this._relationship.Unmarshal(dis);
- this._partLocation.Unmarshal(dis);
- this._namedLocationID.Unmarshal(dis);
- this._partEntityType.Unmarshal(dis);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public override void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- base.Reflection(sb);
- try
- {
- sb.AppendLine("");
- this._orginatingEntityID.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- this._receivingEntityID.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- this._relationship.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- this._partLocation.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- this._namedLocationID.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- this._partEntityType.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as IsPartOfPdu;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(IsPartOfPdu obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- ivarsEqual = base.Equals(obj);
-
- if (!this._orginatingEntityID.Equals(obj._orginatingEntityID))
- {
- ivarsEqual = false;
- }
-
- if (!this._receivingEntityID.Equals(obj._receivingEntityID))
- {
- ivarsEqual = false;
- }
-
- if (!this._relationship.Equals(obj._relationship))
- {
- ivarsEqual = false;
- }
-
- if (!this._partLocation.Equals(obj._partLocation))
- {
- ivarsEqual = false;
- }
-
- if (!this._namedLocationID.Equals(obj._namedLocationID))
- {
- ivarsEqual = false;
- }
-
- if (!this._partEntityType.Equals(obj._partEntityType))
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ base.GetHashCode();
-
- result = GenerateHash(result) ^ this._orginatingEntityID.GetHashCode();
- result = GenerateHash(result) ^ this._receivingEntityID.GetHashCode();
- result = GenerateHash(result) ^ this._relationship.GetHashCode();
- result = GenerateHash(result) ^ this._partLocation.GetHashCode();
- result = GenerateHash(result) ^ this._namedLocationID.GetHashCode();
- result = GenerateHash(result) ^ this._partEntityType.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/JammingTechnique.cs b/tests/OpenDisNet.Reference/Generated/JammingTechnique.cs
deleted file mode 100644
index bed5994..0000000
--- a/tests/OpenDisNet.Reference/Generated/JammingTechnique.cs
+++ /dev/null
@@ -1,349 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Jamming technique. Section 6.2.50
- ///
- [Serializable]
- [XmlRoot]
- public partial class JammingTechnique
- {
- private byte _kind;
-
- private byte _category;
-
- private byte _subcategory;
-
- private byte _specific;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public JammingTechnique()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(JammingTechnique left, JammingTechnique right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(JammingTechnique left, JammingTechnique right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += 1; // this._kind
- marshalSize += 1; // this._category
- marshalSize += 1; // this._subcategory
- marshalSize += 1; // this._specific
- return marshalSize;
- }
-
- [XmlElement(Type = typeof(byte), ElementName = "kind")]
- public byte Kind
- {
- get
- {
- return this._kind;
- }
-
- set
- {
- this._kind = value;
- }
- }
-
- [XmlElement(Type = typeof(byte), ElementName = "category")]
- public byte Category
- {
- get
- {
- return this._category;
- }
-
- set
- {
- this._category = value;
- }
- }
-
- [XmlElement(Type = typeof(byte), ElementName = "subcategory")]
- public byte Subcategory
- {
- get
- {
- return this._subcategory;
- }
-
- set
- {
- this._subcategory = value;
- }
- }
-
- [XmlElement(Type = typeof(byte), ElementName = "specific")]
- public byte Specific
- {
- get
- {
- return this._specific;
- }
-
- set
- {
- this._specific = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedByte((byte)this._kind);
- dos.WriteUnsignedByte((byte)this._category);
- dos.WriteUnsignedByte((byte)this._subcategory);
- dos.WriteUnsignedByte((byte)this._specific);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._kind = dis.ReadUnsignedByte();
- this._category = dis.ReadUnsignedByte();
- this._subcategory = dis.ReadUnsignedByte();
- this._specific = dis.ReadUnsignedByte();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("" + this._kind.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._category.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._subcategory.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._specific.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as JammingTechnique;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(JammingTechnique obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (this._kind != obj._kind)
- {
- ivarsEqual = false;
- }
-
- if (this._category != obj._category)
- {
- ivarsEqual = false;
- }
-
- if (this._subcategory != obj._subcategory)
- {
- ivarsEqual = false;
- }
-
- if (this._specific != obj._specific)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._kind.GetHashCode();
- result = GenerateHash(result) ^ this._category.GetHashCode();
- result = GenerateHash(result) ^ this._subcategory.GetHashCode();
- result = GenerateHash(result) ^ this._specific.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/LaunchedMunitionRecord.cs b/tests/OpenDisNet.Reference/Generated/LaunchedMunitionRecord.cs
deleted file mode 100644
index 8bbb052..0000000
--- a/tests/OpenDisNet.Reference/Generated/LaunchedMunitionRecord.cs
+++ /dev/null
@@ -1,437 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// Identity of a communications node. Section 6.2.51
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(EventIdentifier))]
- [XmlInclude(typeof(Vector3Double))]
- public partial class LaunchedMunitionRecord
- {
- private EventIdentifier _fireEventID = new EventIdentifier();
-
- private ushort _padding;
-
- private EventIdentifier _firingEntityID = new EventIdentifier();
-
- private ushort _padding2;
-
- private EventIdentifier _targetEntityID = new EventIdentifier();
-
- private ushort _padding3;
-
- private Vector3Double _targetLocation = new Vector3Double();
-
- ///
- /// Initializes a new instance of the class.
- ///
- public LaunchedMunitionRecord()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(LaunchedMunitionRecord left, LaunchedMunitionRecord right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(LaunchedMunitionRecord left, LaunchedMunitionRecord right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += this._fireEventID.GetMarshalledSize(); // this._fireEventID
- marshalSize += 2; // this._padding
- marshalSize += this._firingEntityID.GetMarshalledSize(); // this._firingEntityID
- marshalSize += 2; // this._padding2
- marshalSize += this._targetEntityID.GetMarshalledSize(); // this._targetEntityID
- marshalSize += 2; // this._padding3
- marshalSize += this._targetLocation.GetMarshalledSize(); // this._targetLocation
- return marshalSize;
- }
-
- [XmlElement(Type = typeof(EventIdentifier), ElementName = "fireEventID")]
- public EventIdentifier FireEventID
- {
- get
- {
- return this._fireEventID;
- }
-
- set
- {
- this._fireEventID = value;
- }
- }
-
- [XmlElement(Type = typeof(ushort), ElementName = "padding")]
- public ushort Padding
- {
- get
- {
- return this._padding;
- }
-
- set
- {
- this._padding = value;
- }
- }
-
- [XmlElement(Type = typeof(EventIdentifier), ElementName = "firingEntityID")]
- public EventIdentifier FiringEntityID
- {
- get
- {
- return this._firingEntityID;
- }
-
- set
- {
- this._firingEntityID = value;
- }
- }
-
- [XmlElement(Type = typeof(ushort), ElementName = "padding2")]
- public ushort Padding2
- {
- get
- {
- return this._padding2;
- }
-
- set
- {
- this._padding2 = value;
- }
- }
-
- [XmlElement(Type = typeof(EventIdentifier), ElementName = "targetEntityID")]
- public EventIdentifier TargetEntityID
- {
- get
- {
- return this._targetEntityID;
- }
-
- set
- {
- this._targetEntityID = value;
- }
- }
-
- [XmlElement(Type = typeof(ushort), ElementName = "padding3")]
- public ushort Padding3
- {
- get
- {
- return this._padding3;
- }
-
- set
- {
- this._padding3 = value;
- }
- }
-
- [XmlElement(Type = typeof(Vector3Double), ElementName = "targetLocation")]
- public Vector3Double TargetLocation
- {
- get
- {
- return this._targetLocation;
- }
-
- set
- {
- this._targetLocation = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- this._fireEventID.Marshal(dos);
- dos.WriteUnsignedShort((ushort)this._padding);
- this._firingEntityID.Marshal(dos);
- dos.WriteUnsignedShort((ushort)this._padding2);
- this._targetEntityID.Marshal(dos);
- dos.WriteUnsignedShort((ushort)this._padding3);
- this._targetLocation.Marshal(dos);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._fireEventID.Unmarshal(dis);
- this._padding = dis.ReadUnsignedShort();
- this._firingEntityID.Unmarshal(dis);
- this._padding2 = dis.ReadUnsignedShort();
- this._targetEntityID.Unmarshal(dis);
- this._padding3 = dis.ReadUnsignedShort();
- this._targetLocation.Unmarshal(dis);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("");
- this._fireEventID.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._padding.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- this._firingEntityID.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._padding2.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- this._targetEntityID.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("" + this._padding3.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- this._targetLocation.Reflection(sb);
- sb.AppendLine("");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as LaunchedMunitionRecord;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(LaunchedMunitionRecord obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (!this._fireEventID.Equals(obj._fireEventID))
- {
- ivarsEqual = false;
- }
-
- if (this._padding != obj._padding)
- {
- ivarsEqual = false;
- }
-
- if (!this._firingEntityID.Equals(obj._firingEntityID))
- {
- ivarsEqual = false;
- }
-
- if (this._padding2 != obj._padding2)
- {
- ivarsEqual = false;
- }
-
- if (!this._targetEntityID.Equals(obj._targetEntityID))
- {
- ivarsEqual = false;
- }
-
- if (this._padding3 != obj._padding3)
- {
- ivarsEqual = false;
- }
-
- if (!this._targetLocation.Equals(obj._targetLocation))
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._fireEventID.GetHashCode();
- result = GenerateHash(result) ^ this._padding.GetHashCode();
- result = GenerateHash(result) ^ this._firingEntityID.GetHashCode();
- result = GenerateHash(result) ^ this._padding2.GetHashCode();
- result = GenerateHash(result) ^ this._targetEntityID.GetHashCode();
- result = GenerateHash(result) ^ this._padding3.GetHashCode();
- result = GenerateHash(result) ^ this._targetLocation.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/LayerHeader.cs b/tests/OpenDisNet.Reference/Generated/LayerHeader.cs
deleted file mode 100644
index aedfeaf..0000000
--- a/tests/OpenDisNet.Reference/Generated/LayerHeader.cs
+++ /dev/null
@@ -1,335 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// The identification of the additional information layer number, layer-specific information, and the length of the layer. Section 6.2.52
- ///
- [Serializable]
- [XmlRoot]
- public partial class LayerHeader
- {
- private byte _layerNumber;
-
- ///
- /// field shall specify layer-specific information that varies by System Type (see 6.2.86) and Layer Number.
- ///
- private byte _layerSpecificInformation;
-
- ///
- /// This field shall specify the length in octets of the layer, including the Layer Header record
- ///
- private ushort _length;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public LayerHeader()
- {
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(LayerHeader left, LayerHeader right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(LayerHeader left, LayerHeader right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public virtual int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize += 1; // this._layerNumber
- marshalSize += 1; // this._layerSpecificInformation
- marshalSize += 2; // this._length
- return marshalSize;
- }
-
- [XmlElement(Type = typeof(byte), ElementName = "layerNumber")]
- public byte LayerNumber
- {
- get
- {
- return this._layerNumber;
- }
-
- set
- {
- this._layerNumber = value;
- }
- }
-
- ///
- /// Gets or sets the field shall specify layer-specific information that varies by System Type (see 6.2.86) and Layer Number.
- ///
- [XmlElement(Type = typeof(byte), ElementName = "layerSpecificInformation")]
- public byte LayerSpecificInformation
- {
- get
- {
- return this._layerSpecificInformation;
- }
-
- set
- {
- this._layerSpecificInformation = value;
- }
- }
-
- ///
- /// Gets or sets the This field shall specify the length in octets of the layer, including the Layer Header record
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "length")]
- public ushort Length
- {
- get
- {
- return this._length;
- }
-
- set
- {
- this._length = value;
- }
- }
-
- ///
- /// Occurs when exception when processing PDU is caught.
- ///
- public event Action Exception;
-
- ///
- /// Called when exception occurs (raises the event).
- ///
- /// The exception.
- protected void OnException(Exception e)
- {
- if (this.Exception != null)
- {
- this.Exception(e);
- }
- }
-
- ///
- /// Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method
- ///
- /// The DataOutputStream instance to which the PDU is marshaled.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Marshal(DataOutputStream dos)
- {
- if (dos != null)
- {
- try
- {
- dos.WriteUnsignedByte((byte)this._layerNumber);
- dos.WriteUnsignedByte((byte)this._layerSpecificInformation);
- dos.WriteUnsignedShort((ushort)this._length);
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Unmarshal(DataInputStream dis)
- {
- if (dis != null)
- {
- try
- {
- this._layerNumber = dis.ReadUnsignedByte();
- this._layerSpecificInformation = dis.ReadUnsignedByte();
- this._length = dis.ReadUnsignedShort();
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
- }
-
- ///
- /// This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging.
- /// This will be modified in the future to provide a better display. Usage:
- /// pdu.GetType().InvokeMember("Reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
- /// where pdu is an object representing a single pdu and sb is a StringBuilder.
- /// Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
- ///
- /// The StringBuilder instance to which the PDU is written to.
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Due to ignoring errors.")]
- public virtual void Reflection(StringBuilder sb)
- {
- sb.AppendLine("");
- try
- {
- sb.AppendLine("" + this._layerNumber.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._layerSpecificInformation.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("" + this._length.ToString(CultureInfo.InvariantCulture) + "");
- sb.AppendLine("");
- }
- catch (Exception e)
- {
-#if DEBUG
- Trace.WriteLine(e);
- Trace.Flush();
-#endif
- this.OnException(e);
- }
- }
-
- ///
- /// Determines whether the specified is equal to this instance.
- ///
- /// The to compare with this instance.
- ///
- /// true if the specified is equal to this instance; otherwise, false.
- ///
- public override bool Equals(object obj)
- {
- return this == obj as LayerHeader;
- }
-
- ///
- /// Compares for reference AND value equality.
- ///
- /// The object to compare with this instance.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public bool Equals(LayerHeader obj)
- {
- bool ivarsEqual = true;
-
- if (obj.GetType() != this.GetType())
- {
- return false;
- }
-
- if (this._layerNumber != obj._layerNumber)
- {
- ivarsEqual = false;
- }
-
- if (this._layerSpecificInformation != obj._layerSpecificInformation)
- {
- ivarsEqual = false;
- }
-
- if (this._length != obj._length)
- {
- ivarsEqual = false;
- }
-
- return ivarsEqual;
- }
-
- ///
- /// HashCode Helper
- ///
- /// The hash value.
- /// The new hash value.
- private static int GenerateHash(int hash)
- {
- hash = hash << (5 + hash);
- return hash;
- }
-
- ///
- /// Gets the hash code.
- ///
- /// The hash code.
- public override int GetHashCode()
- {
- int result = 0;
-
- result = GenerateHash(result) ^ this._layerNumber.GetHashCode();
- result = GenerateHash(result) ^ this._layerSpecificInformation.GetHashCode();
- result = GenerateHash(result) ^ this._length.GetHashCode();
-
- return result;
- }
- }
-}
diff --git a/tests/OpenDisNet.Reference/Generated/LinearObjectStatePdu.cs b/tests/OpenDisNet.Reference/Generated/LinearObjectStatePdu.cs
deleted file mode 100644
index d73ebc9..0000000
--- a/tests/OpenDisNet.Reference/Generated/LinearObjectStatePdu.cs
+++ /dev/null
@@ -1,589 +0,0 @@
-// Copyright (c) 1995-2009 held by the author(s). All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the names of the Naval Postgraduate School (NPS)
-// Modeling Virtual Environments and Simulation (MOVES) Institute
-// (http://www.nps.edu and http://www.MovesInstitute.org)
-// nor the names of its contributors may be used to endorse or
-// promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Copyright (c) 2008, MOVES Institute, Naval Postgraduate School. All
-// rights reserved. This work is licensed under the BSD open source license,
-// available at https://www.movesinstitute.org/licenses/bsd.html
-//
-// Author: DMcG
-// Modified for use with C#:
-// - Peter Smith (Naval Air Warfare Center - Training Systems Division)
-// - Zvonko Bostjancic (Blubit d.o.o. - zvonko.bostjancic@blubit.si)
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using DISnet.DataStreamUtilities;
-
-namespace DISnet
-{
- ///
- /// : Information abut the addition or modification of a synthecic enviroment object that is anchored to the terrain with a single point and has size or orientation. Section 7.10.5 COMPLETE
- ///
- [Serializable]
- [XmlRoot]
- [XmlInclude(typeof(EntityID))]
- [XmlInclude(typeof(SimulationAddress))]
- [XmlInclude(typeof(ObjectType))]
- [XmlInclude(typeof(LinearSegmentParameter))]
- public partial class LinearObjectStatePdu : SyntheticEnvironmentFamilyPdu, IEquatable
- {
- ///
- /// Object in synthetic environment
- ///
- private EntityID _objectID = new EntityID();
-
- ///
- /// Object with which this point object is associated
- ///
- private EntityID _referencedObjectID = new EntityID();
-
- ///
- /// unique update number of each state transition of an object
- ///
- private ushort _updateNumber;
-
- ///
- /// force ID
- ///
- private byte _forceID;
-
- ///
- /// number of linear segment parameters
- ///
- private byte _numberOfSegments;
-
- ///
- /// requesterID
- ///
- private SimulationAddress _requesterID = new SimulationAddress();
-
- ///
- /// receiver ID
- ///
- private SimulationAddress _receivingID = new SimulationAddress();
-
- ///
- /// Object type
- ///
- private ObjectType _objectType = new ObjectType();
-
- ///
- /// Linear segment parameters
- ///
- private List _linearSegmentParameters = new List();
-
- ///
- /// Initializes a new instance of the class.
- ///
- public LinearObjectStatePdu()
- {
- PduType = (byte)44;
- }
-
- ///
- /// Implements the operator !=.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if operands are not equal; otherwise, false.
- ///
- public static bool operator !=(LinearObjectStatePdu left, LinearObjectStatePdu right)
- {
- return !(left == right);
- }
-
- ///
- /// Implements the operator ==.
- ///
- /// The left operand.
- /// The right operand.
- ///
- /// true if both operands are equal; otherwise, false.
- ///
- public static bool operator ==(LinearObjectStatePdu left, LinearObjectStatePdu right)
- {
- if (object.ReferenceEquals(left, right))
- {
- return true;
- }
-
- if (((object)left == null) || ((object)right == null))
- {
- return false;
- }
-
- return left.Equals(right);
- }
-
- public override int GetMarshalledSize()
- {
- int marshalSize = 0;
-
- marshalSize = base.GetMarshalledSize();
- marshalSize += this._objectID.GetMarshalledSize(); // this._objectID
- marshalSize += this._referencedObjectID.GetMarshalledSize(); // this._referencedObjectID
- marshalSize += 2; // this._updateNumber
- marshalSize += 1; // this._forceID
- marshalSize += 1; // this._numberOfSegments
- marshalSize += this._requesterID.GetMarshalledSize(); // this._requesterID
- marshalSize += this._receivingID.GetMarshalledSize(); // this._receivingID
- marshalSize += this._objectType.GetMarshalledSize(); // this._objectType
- for (int idx = 0; idx < this._linearSegmentParameters.Count; idx++)
- {
- LinearSegmentParameter listElement = (LinearSegmentParameter)this._linearSegmentParameters[idx];
- marshalSize += listElement.GetMarshalledSize();
- }
-
- return marshalSize;
- }
-
- ///
- /// Gets or sets the Object in synthetic environment
- ///
- [XmlElement(Type = typeof(EntityID), ElementName = "objectID")]
- public EntityID ObjectID
- {
- get
- {
- return this._objectID;
- }
-
- set
- {
- this._objectID = value;
- }
- }
-
- ///
- /// Gets or sets the Object with which this point object is associated
- ///
- [XmlElement(Type = typeof(EntityID), ElementName = "referencedObjectID")]
- public EntityID ReferencedObjectID
- {
- get
- {
- return this._referencedObjectID;
- }
-
- set
- {
- this._referencedObjectID = value;
- }
- }
-
- ///
- /// Gets or sets the unique update number of each state transition of an object
- ///
- [XmlElement(Type = typeof(ushort), ElementName = "updateNumber")]
- public ushort UpdateNumber
- {
- get
- {
- return this._updateNumber;
- }
-
- set
- {
- this._updateNumber = value;
- }
- }
-
- ///
- /// Gets or sets the force ID
- ///
- [XmlElement(Type = typeof(byte), ElementName = "forceID")]
- public byte ForceID
- {
- get
- {
- return this._forceID;
- }
-
- set
- {
- this._forceID = value;
- }
- }
-
- ///
- /// Note that setting this value will not change the marshalled value. The list whose length this describes is used for that purpose.
- /// The getnumberOfSegments method will also be based on the actual list length rather than this value.
- /// The method is simply here for completeness and should not be used for any computations.
- ///
- [XmlElement(Type = typeof(byte), ElementName = "numberOfSegments")]
- public byte NumberOfSegments
- {
- get
- {
- return this._numberOfSegments;
- }
-
- set
- {
- this._numberOfSegments = value;
- }
- }
-
- ///
- /// Gets or sets the requesterID
- ///
- [XmlElement(Type = typeof(SimulationAddress), ElementName = "requesterID")]
- public SimulationAddress RequesterID
- {
- get
- {
- return this._requesterID;
- }
-
- set
- {
- this._requesterID = value;
- }
- }
-
- ///
- /// Gets or sets the receiver ID
- ///
- [XmlElement(Type = typeof(SimulationAddress), ElementName = "receivingID")]
- public SimulationAddress ReceivingID
- {
- get
- {
- return this._receivingID;
- }
-
- set
- {
- this._receivingID = value;
- }
- }
-
- ///
- /// Gets or sets the Object type
- ///
- [XmlElement(Type = typeof(ObjectType), ElementName = "objectType")]
- public ObjectType ObjectType
- {
- get
- {
- return this._objectType;
- }
-
- set
- {
- this._objectType = value;
- }
- }
-
- ///
- /// Gets or sets the Linear segment parameters
- ///
- [XmlElement(ElementName = "linearSegmentParametersList", Type = typeof(List))]
- public List LinearSegmentParameters
- {
- get
- {
- return this._linearSegmentParameters;
- }
- }
-
- ///