Skip to content

Commit

Permalink
Update APIs (NWNX: 0e77a56d, NWN: 8193.36-7).
Browse files Browse the repository at this point in the history
  • Loading branch information
jhett12321 committed Dec 10, 2023
1 parent 6dc4db0 commit d9b0994
Show file tree
Hide file tree
Showing 30 changed files with 2,553 additions and 766 deletions.
5 changes: 2 additions & 3 deletions src/main/API/CERFFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,8 @@ public int WriteResource(byte* szResName, ushort rtResType, CRes pRes) {
return retVal;
}

public int WriteResource(byte* szResName, ushort rtResType, SWIGTYPE_p_std__shared_ptrT_DataView_t pData) {
int retVal = NWNXLibPINVOKE.CERFFile_WriteResource__SWIG_2(swigCPtr, szResName, rtResType, SWIGTYPE_p_std__shared_ptrT_DataView_t.getCPtr(pData));
if (NWNXLibPINVOKE.SWIGPendingException.Pending) throw NWNXLibPINVOKE.SWIGPendingException.Retrieve();
public int WriteResource(byte* szResName, ushort rtResType, DataView pData) {
int retVal = NWNXLibPINVOKE.CERFFile_WriteResource__SWIG_2(swigCPtr, szResName, rtResType, DataView.getCPtr(pData));
return retVal;
}

Expand Down
375 changes: 375 additions & 0 deletions src/main/API/CExoArrayListCLastUpdateObjectPtr.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,375 @@
//------------------------------------------------------------------------------
// <auto-generated />
//
// This file was automatically generated by SWIG (http://www.swig.org).
// Version 4.0.2
//
// Do not make changes to this file unless you know what you are doing--modify
// the SWIG interface file instead.
//------------------------------------------------------------------------------

namespace NWN.Native.API {

public unsafe class CExoArrayListCLastUpdateObjectPtr : global::System.IDisposable, global::System.Collections.IEnumerable, global::System.Collections.Generic.IList<CLastUpdateObject>
{
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
protected bool swigCMemOwn;

internal CExoArrayListCLastUpdateObjectPtr(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(CExoArrayListCLastUpdateObjectPtr obj) {
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
}

~CExoArrayListCLastUpdateObjectPtr() {
Dispose(false);
}

public void Dispose() {
Dispose(true);
global::System.GC.SuppressFinalize(this);
}

protected virtual void Dispose(bool disposing) {
lock(this) {
if (swigCPtr.Handle != global::System.IntPtr.Zero) {
if (swigCMemOwn) {
swigCMemOwn = false;
NWNXLibPINVOKE.delete_CExoArrayListCLastUpdateObjectPtr(swigCPtr);
}
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
}
}
}

public global::System.IntPtr Pointer {
get {
return swigCPtr.Handle;
}
}

public static unsafe implicit operator void*(CExoArrayListCLastUpdateObjectPtr self) {
return (void*)self.swigCPtr.Handle;
}

public static unsafe CExoArrayListCLastUpdateObjectPtr FromPointer(void* pointer, bool memoryOwn = false) {
return pointer != null ? new CExoArrayListCLastUpdateObjectPtr((global::System.IntPtr)pointer, memoryOwn) : null;
}

public static CExoArrayListCLastUpdateObjectPtr FromPointer(global::System.IntPtr pointer, bool memoryOwn = false) {
return pointer != global::System.IntPtr.Zero ? new CExoArrayListCLastUpdateObjectPtr(pointer, memoryOwn) : null;
}

public bool Equals(CExoArrayListCLastUpdateObjectPtr other) {
if (ReferenceEquals(null, other)) {
return false;
}

if (ReferenceEquals(this, other)) {
return true;
}

return Pointer.Equals(other.Pointer);
}

public override bool Equals(object obj) {
return ReferenceEquals(this, obj) || obj is CExoArrayListCLastUpdateObjectPtr other && Equals(other);
}

public override int GetHashCode() {
return swigCPtr.Handle.GetHashCode();
}

public static bool operator ==(CExoArrayListCLastUpdateObjectPtr left, CExoArrayListCLastUpdateObjectPtr right) {
return Equals(left, right);
}

public static bool operator !=(CExoArrayListCLastUpdateObjectPtr left, CExoArrayListCLastUpdateObjectPtr right) {
return !Equals(left, right);
}

public CExoArrayListCLastUpdateObjectPtr(global::System.Collections.IEnumerable c) : this() {
if (c == null)
throw new global::System.ArgumentNullException("c");
foreach (CLastUpdateObject element in c) {
this.Add(element);
}
}

public CExoArrayListCLastUpdateObjectPtr(global::System.Collections.Generic.IEnumerable<CLastUpdateObject> c) : this() {
if (c == null)
throw new global::System.ArgumentNullException("c");
foreach (CLastUpdateObject element in c) {
this.Add(element);
}
}

public bool IsFixedSize {
get {
return false;
}
}

public bool IsReadOnly {
get {
return false;
}
}

public CLastUpdateObject this[int index] {
get {
return InternalGetItem(index);
}
set {
InternalSetItem(index, value);
}
}

public int Capacity {
get {
return (int)array_size;
}
set {
if (value < num)
throw new global::System.ArgumentOutOfRangeException("Capacity");
SetSize(value);
}
}

public int Count {
get {
return (int)num;
}
}

public bool IsSynchronized {
get {
return false;
}
}

public void CopyTo(CLastUpdateObject[] array)
{
CopyTo(0, array, 0, this.Count);
}

public void CopyTo(CLastUpdateObject[] array, int arrayIndex)
{
CopyTo(0, array, arrayIndex, this.Count);
}

public void Clear()
{
SetSize(0);
}

public void CopyTo(int index, CLastUpdateObject[] array, int arrayIndex, int count)
{
if (array == null)
throw new global::System.ArgumentNullException("array");
if (index < 0)
throw new global::System.ArgumentOutOfRangeException("index", "Value is less than zero");
if (arrayIndex < 0)
throw new global::System.ArgumentOutOfRangeException("arrayIndex", "Value is less than zero");
if (count < 0)
throw new global::System.ArgumentOutOfRangeException("count", "Value is less than zero");
if (array.Rank > 1)
throw new global::System.ArgumentException("Multi dimensional array.", "array");
if (index+count > this.Count || arrayIndex+count > array.Length)
throw new global::System.ArgumentException("Number of elements to copy is too large.");
for (int i=0; i<count; i++)
array.SetValue(InternalGetItemCopy(index+i), arrayIndex+i);
}

public CLastUpdateObject[] ToArray() {
CLastUpdateObject[] array = new CLastUpdateObject[this.Count];
this.CopyTo(array);
return array;
}

global::System.Collections.Generic.IEnumerator<CLastUpdateObject> global::System.Collections.Generic.IEnumerable<CLastUpdateObject>.GetEnumerator() {
return new CExoArrayListCLastUpdateObjectPtrEnumerator(this);
}

global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() {
return new CExoArrayListCLastUpdateObjectPtrEnumerator(this);
}

public CExoArrayListCLastUpdateObjectPtrEnumerator GetEnumerator() {
return new CExoArrayListCLastUpdateObjectPtrEnumerator(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 CExoArrayListCLastUpdateObjectPtrEnumerator : global::System.Collections.IEnumerator
, global::System.Collections.Generic.IEnumerator<CLastUpdateObject>
{
private CExoArrayListCLastUpdateObjectPtr collectionRef;
private int currentIndex;
private object currentObject;
private int currentSize;

public CExoArrayListCLastUpdateObjectPtrEnumerator(CExoArrayListCLastUpdateObjectPtr collection) {
collectionRef = collection;
currentIndex = -1;
currentObject = null;
currentSize = collectionRef.Count;
}

// Type-safe iterator Current
public CLastUpdateObject 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 (CLastUpdateObject)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++;
currentObject = collectionRef[currentIndex];
} 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;
}
}

private int num {
set {
NWNXLibPINVOKE.CExoArrayListCLastUpdateObjectPtr_num_set(swigCPtr, value);
}
get {
int retVal = NWNXLibPINVOKE.CExoArrayListCLastUpdateObjectPtr_num_get(swigCPtr);
return retVal;
}

}

private int array_size {
set {
NWNXLibPINVOKE.CExoArrayListCLastUpdateObjectPtr_array_size_set(swigCPtr, value);
}
get {
int retVal = NWNXLibPINVOKE.CExoArrayListCLastUpdateObjectPtr_array_size_get(swigCPtr);
return retVal;
}

}

public void Add(CLastUpdateObject t) {
NWNXLibPINVOKE.CExoArrayListCLastUpdateObjectPtr_Add(swigCPtr, CLastUpdateObject.getCPtr(t));
}

public void Pack() {
NWNXLibPINVOKE.CExoArrayListCLastUpdateObjectPtr_Pack(swigCPtr);
}

private void Allocate(int s) {
NWNXLibPINVOKE.CExoArrayListCLastUpdateObjectPtr_Allocate(swigCPtr, s);
}

public void SetSize(int s) {
NWNXLibPINVOKE.CExoArrayListCLastUpdateObjectPtr_SetSize(swigCPtr, s);
}

public CExoArrayListCLastUpdateObjectPtr(int s) : this(NWNXLibPINVOKE.new_CExoArrayListCLastUpdateObjectPtr__SWIG_0(s), true) {
}

public CExoArrayListCLastUpdateObjectPtr() : this(NWNXLibPINVOKE.new_CExoArrayListCLastUpdateObjectPtr__SWIG_1(), true) {
}

public CExoArrayListCLastUpdateObjectPtr(CExoArrayListCLastUpdateObjectPtr list) : this(NWNXLibPINVOKE.new_CExoArrayListCLastUpdateObjectPtr__SWIG_2(CExoArrayListCLastUpdateObjectPtr.getCPtr(list)), true) {
if (NWNXLibPINVOKE.SWIGPendingException.Pending) throw NWNXLibPINVOKE.SWIGPendingException.Retrieve();
}

public void RemoveAt(int index) {
NWNXLibPINVOKE.CExoArrayListCLastUpdateObjectPtr_RemoveAt(swigCPtr, index);
if (NWNXLibPINVOKE.SWIGPendingException.Pending) throw NWNXLibPINVOKE.SWIGPendingException.Retrieve();
}

public int IndexOf(CLastUpdateObject t) {
int retVal = NWNXLibPINVOKE.CExoArrayListCLastUpdateObjectPtr_IndexOf(swigCPtr, CLastUpdateObject.getCPtr(t));
return retVal;
}

public int AddUnique(CLastUpdateObject t) {
int retVal = NWNXLibPINVOKE.CExoArrayListCLastUpdateObjectPtr_AddUnique(swigCPtr, CLastUpdateObject.getCPtr(t));
return retVal;
}

private CLastUpdateObject InternalGetItem(int index) {
global::System.IntPtr cPtr = NWNXLibPINVOKE.CExoArrayListCLastUpdateObjectPtr_InternalGetItem(swigCPtr, index);
CLastUpdateObject ret = (cPtr == global::System.IntPtr.Zero) ? null : new CLastUpdateObject(cPtr, false);
if (NWNXLibPINVOKE.SWIGPendingException.Pending) throw NWNXLibPINVOKE.SWIGPendingException.Retrieve();
return ret;
}

private CLastUpdateObject InternalGetItemCopy(int index) {
global::System.IntPtr cPtr = NWNXLibPINVOKE.CExoArrayListCLastUpdateObjectPtr_InternalGetItemCopy(swigCPtr, index);
CLastUpdateObject ret = (cPtr == global::System.IntPtr.Zero) ? null : new CLastUpdateObject(cPtr, false);
if (NWNXLibPINVOKE.SWIGPendingException.Pending) throw NWNXLibPINVOKE.SWIGPendingException.Retrieve();
return ret;
}

private void InternalSetItem(int index, CLastUpdateObject val) {
NWNXLibPINVOKE.CExoArrayListCLastUpdateObjectPtr_InternalSetItem(swigCPtr, index, CLastUpdateObject.getCPtr(val));
if (NWNXLibPINVOKE.SWIGPendingException.Pending) throw NWNXLibPINVOKE.SWIGPendingException.Retrieve();
}

public void Insert(int index, CLastUpdateObject x) {
NWNXLibPINVOKE.CExoArrayListCLastUpdateObjectPtr_Insert(swigCPtr, index, CLastUpdateObject.getCPtr(x));
if (NWNXLibPINVOKE.SWIGPendingException.Pending) throw NWNXLibPINVOKE.SWIGPendingException.Retrieve();
}

public bool Contains(CLastUpdateObject value) {
bool ret = NWNXLibPINVOKE.CExoArrayListCLastUpdateObjectPtr_Contains(swigCPtr, CLastUpdateObject.getCPtr(value));
return ret;
}

public int LastIndexOf(CLastUpdateObject value) {
int retVal = NWNXLibPINVOKE.CExoArrayListCLastUpdateObjectPtr_LastIndexOf(swigCPtr, CLastUpdateObject.getCPtr(value));
return retVal;
}

public bool Remove(CLastUpdateObject value) {
bool ret = NWNXLibPINVOKE.CExoArrayListCLastUpdateObjectPtr_Remove(swigCPtr, CLastUpdateObject.getCPtr(value));
return ret;
}

}

}
Loading

0 comments on commit d9b0994

Please sign in to comment.