quad tree for visibility wip

This commit is contained in:
2016-12-25 14:56:41 +07:00
parent a7f4fee821
commit 864727a50d
11 changed files with 542 additions and 440 deletions

View File

@@ -3,6 +3,22 @@
namespace IsoTools.Internal {
public class IsoGrid<T> {
// ---------------------------------------------------------------------
//
// Interfaces
//
// ---------------------------------------------------------------------
public interface IItemAdapter {
IsoRect GetBounds (T item);
void SetMinMaxCells (T item, IsoPoint2 min, IsoPoint2 max);
void GetMinMaxCells (T item, ref IsoPoint2 min, ref IsoPoint2 max);
}
public interface ILookUpper {
void LookUp(IsoList<T> items);
}
// ---------------------------------------------------------------------
//
// CellPool
@@ -26,22 +42,6 @@ namespace IsoTools.Internal {
}
}
// ---------------------------------------------------------------------
//
// Interfaces
//
// ---------------------------------------------------------------------
public interface IItemAdapter {
IsoRect GetBounds (T item);
void SetMinMaxCells (T item, IsoPoint2 min, IsoPoint2 max);
void GetMinMaxCells (T item, ref IsoPoint2 min, ref IsoPoint2 max);
}
public interface ILookUpper {
void LookUp(IsoList<T> items);
}
// ---------------------------------------------------------------------
//
// Members
@@ -79,8 +79,8 @@ namespace IsoTools.Internal {
_itemAdapter = item_adapter;
}
public void AddItem(T content) {
_gridItems.Add(content);
public void AddItem(T item) {
_gridItems.Add(item);
}
public void ClearItems() {