//------------------------------------------------------------------------------
//
//
// This file was automatically generated by SWIG (http://www.swig.org).
// Version 3.0.6
//
// Do not make changes to this file unless you know what you are doing--modify
// the SWIG interface file instead.
//------------------------------------------------------------------------------
namespace mscl {
public class DamageAngles : global::System.IDisposable
, global::System.Collections.Generic.IDictionary
{
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
protected bool swigCMemOwn;
internal DamageAngles(global::System.IntPtr cPtr, bool cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
}
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(DamageAngles obj) {
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
}
~DamageAngles() {
Dispose();
}
public virtual void Dispose() {
lock(this) {
if (swigCPtr.Handle != global::System.IntPtr.Zero) {
if (swigCMemOwn) {
swigCMemOwn = false;
msclPINVOKE.delete_DamageAngles(swigCPtr);
}
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
}
global::System.GC.SuppressFinalize(this);
}
}
public float this[byte key] {
get {
return getitem(key);
}
set {
setitem(key, value);
}
}
public bool TryGetValue(byte key, out float value) {
if (this.ContainsKey(key)) {
value = this[key];
return true;
}
value = default(float);
return false;
}
public int Count {
get {
return (int)size();
}
}
public bool IsReadOnly {
get {
return false;
}
}
public global::System.Collections.Generic.ICollection Keys {
get {
global::System.Collections.Generic.ICollection keys = new global::System.Collections.Generic.List();
int size = this.Count;
if (size > 0) {
global::System.IntPtr iter = create_iterator_begin();
for (int i = 0; i < size; i++) {
keys.Add(get_next_key(iter));
}
destroy_iterator(iter);
}
return keys;
}
}
public global::System.Collections.Generic.ICollection Values {
get {
global::System.Collections.Generic.ICollection vals = new global::System.Collections.Generic.List();
foreach (global::System.Collections.Generic.KeyValuePair pair in this) {
vals.Add(pair.Value);
}
return vals;
}
}
public void Add(global::System.Collections.Generic.KeyValuePair item) {
Add(item.Key, item.Value);
}
public bool Remove(global::System.Collections.Generic.KeyValuePair item) {
if (Contains(item)) {
return Remove(item.Key);
} else {
return false;
}
}
public bool Contains(global::System.Collections.Generic.KeyValuePair item) {
if (this[item.Key] == item.Value) {
return true;
} else {
return false;
}
}
public void CopyTo(global::System.Collections.Generic.KeyValuePair[] array) {
CopyTo(array, 0);
}
public void CopyTo(global::System.Collections.Generic.KeyValuePair[] array, int arrayIndex) {
if (array == null)
throw new global::System.ArgumentNullException("array");
if (arrayIndex < 0)
throw new global::System.ArgumentOutOfRangeException("arrayIndex", "Value is less than zero");
if (array.Rank > 1)
throw new global::System.ArgumentException("Multi dimensional array.", "array");
if (arrayIndex+this.Count > array.Length)
throw new global::System.ArgumentException("Number of elements to copy is too large.");
global::System.Collections.Generic.IList keyList = new global::System.Collections.Generic.List(this.Keys);
for (int i = 0; i < keyList.Count; i++) {
byte currentKey = keyList[i];
array.SetValue(new global::System.Collections.Generic.KeyValuePair(currentKey, this[currentKey]), arrayIndex+i);
}
}
global::System.Collections.Generic.IEnumerator> global::System.Collections.Generic.IEnumerable>.GetEnumerator() {
return new DamageAnglesEnumerator(this);
}
global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() {
return new DamageAnglesEnumerator(this);
}
public DamageAnglesEnumerator GetEnumerator() {
return new DamageAnglesEnumerator(this);
}
// Type-safe enumerator
/// Note that the IEnumerator documentation requires an InvalidOperationException to be thrown
/// whenever the collection is modified. This has been done for changes in the size of the
/// collection but not when one of the elements of the collection is modified as it is a bit
/// tricky to detect unmanaged code that modifies the collection under our feet.
public sealed class DamageAnglesEnumerator : global::System.Collections.IEnumerator,
global::System.Collections.Generic.IEnumerator>
{
private DamageAngles collectionRef;
private global::System.Collections.Generic.IList keyCollection;
private int currentIndex;
private object currentObject;
private int currentSize;
public DamageAnglesEnumerator(DamageAngles collection) {
collectionRef = collection;
keyCollection = new global::System.Collections.Generic.List(collection.Keys);
currentIndex = -1;
currentObject = null;
currentSize = collectionRef.Count;
}
// Type-safe iterator Current
public global::System.Collections.Generic.KeyValuePair Current {
get {
if (currentIndex == -1)
throw new global::System.InvalidOperationException("Enumeration not started.");
if (currentIndex > currentSize - 1)
throw new global::System.InvalidOperationException("Enumeration finished.");
if (currentObject == null)
throw new global::System.InvalidOperationException("Collection modified.");
return (global::System.Collections.Generic.KeyValuePair)currentObject;
}
}
// Type-unsafe IEnumerator.Current
object global::System.Collections.IEnumerator.Current {
get {
return Current;
}
}
public bool MoveNext() {
int size = collectionRef.Count;
bool moveOkay = (currentIndex+1 < size) && (size == currentSize);
if (moveOkay) {
currentIndex++;
byte currentKey = keyCollection[currentIndex];
currentObject = new global::System.Collections.Generic.KeyValuePair(currentKey, collectionRef[currentKey]);
} else {
currentObject = null;
}
return moveOkay;
}
public void Reset() {
currentIndex = -1;
currentObject = null;
if (collectionRef.Count != currentSize) {
throw new global::System.InvalidOperationException("Collection modified.");
}
}
public void Dispose() {
currentIndex = -1;
currentObject = null;
}
}
public DamageAngles() : this(msclPINVOKE.new_DamageAngles__SWIG_0(), true) {
if (msclPINVOKE.SWIGPendingException.Pending) throw msclPINVOKE.SWIGPendingException.Retrieve();
}
public DamageAngles(DamageAngles other) : this(msclPINVOKE.new_DamageAngles__SWIG_1(DamageAngles.getCPtr(other)), true) {
if (msclPINVOKE.SWIGPendingException.Pending) throw msclPINVOKE.SWIGPendingException.Retrieve();
}
private uint size() {
uint ret = msclPINVOKE.DamageAngles_size(swigCPtr);
if (msclPINVOKE.SWIGPendingException.Pending) throw msclPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
public bool empty() {
bool ret = msclPINVOKE.DamageAngles_empty(swigCPtr);
if (msclPINVOKE.SWIGPendingException.Pending) throw msclPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
public void Clear() {
msclPINVOKE.DamageAngles_Clear(swigCPtr);
if (msclPINVOKE.SWIGPendingException.Pending) throw msclPINVOKE.SWIGPendingException.Retrieve();
}
private float getitem(byte key) {
float ret = msclPINVOKE.DamageAngles_getitem(swigCPtr, key);
if (msclPINVOKE.SWIGPendingException.Pending) throw msclPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
private void setitem(byte key, float x) {
msclPINVOKE.DamageAngles_setitem(swigCPtr, key, x);
if (msclPINVOKE.SWIGPendingException.Pending) throw msclPINVOKE.SWIGPendingException.Retrieve();
}
public bool ContainsKey(byte key) {
bool ret = msclPINVOKE.DamageAngles_ContainsKey(swigCPtr, key);
if (msclPINVOKE.SWIGPendingException.Pending) throw msclPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
public void Add(byte key, float val) {
msclPINVOKE.DamageAngles_Add(swigCPtr, key, val);
if (msclPINVOKE.SWIGPendingException.Pending) throw msclPINVOKE.SWIGPendingException.Retrieve();
}
public bool Remove(byte key) {
bool ret = msclPINVOKE.DamageAngles_Remove(swigCPtr, key);
if (msclPINVOKE.SWIGPendingException.Pending) throw msclPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
private global::System.IntPtr create_iterator_begin() {
global::System.IntPtr ret = msclPINVOKE.DamageAngles_create_iterator_begin(swigCPtr);
if (msclPINVOKE.SWIGPendingException.Pending) throw msclPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
private byte get_next_key(global::System.IntPtr swigiterator) {
byte ret = msclPINVOKE.DamageAngles_get_next_key(swigCPtr, swigiterator);
if (msclPINVOKE.SWIGPendingException.Pending) throw msclPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
private void destroy_iterator(global::System.IntPtr swigiterator) {
msclPINVOKE.DamageAngles_destroy_iterator(swigCPtr, swigiterator);
if (msclPINVOKE.SWIGPendingException.Pending) throw msclPINVOKE.SWIGPendingException.Retrieve();
}
}
}