ace/Source/ACE.Server/Physics/Common/CellArray.cs
gmriggs 63ff51eca8 Basic collisions detected and exported (#693)
* Basic collisions detected and exported

* Updating Sphere tests
2018-03-20 02:45:41 -04:00

49 lines
1 KiB
C#

using System.Collections.Generic;
namespace ACE.Server.Physics.Common
{
public class CellArray
{
public bool AddedOutside;
public bool LoadCells;
public Dictionary<uint, ObjCell> Cells;
public int NumCells;
public CellArray()
{
Cells = new Dictionary<uint, ObjCell>();
}
public void SetStatic()
{
AddedOutside = false;
LoadCells = false;
NumCells = 0;
}
public void SetDynamic()
{
AddedOutside = false;
LoadCells = true;
NumCells = 0;
}
public void add_cell(uint cellID, ObjCell cell)
{
if (!Cells.ContainsKey(cellID))
{
Cells.Add(cellID, cell);
NumCells++;
}
}
public void remove_cell(ObjCell cell)
{
if (Cells.ContainsKey(cell.ID))
{
Cells.Remove(cell.ID);
NumCells--;
}
}
}
}