112 lines
2.6 KiB
C#
112 lines
2.6 KiB
C#
using StgSharp.Pool;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Runtime.CompilerServices;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace StgSharp.Logic
|
|
{
|
|
internal class EntityContainer:LinkedList,IContainer
|
|
{
|
|
|
|
private int _limit;
|
|
protected float _leftBorder;
|
|
protected float _rightBorder;
|
|
protected float _topBorder;
|
|
protected float _bottomBorder;
|
|
|
|
public int Limit
|
|
{
|
|
get { return _limit; }
|
|
set { _limit = value; }
|
|
}
|
|
|
|
public float LeftBorder
|
|
{
|
|
get { return _leftBorder; }
|
|
set { _leftBorder = value; }
|
|
}
|
|
public float RightBorder
|
|
{
|
|
get { return _rightBorder; }
|
|
set { _rightBorder = value; }
|
|
}
|
|
public float TopBorder
|
|
{
|
|
get { return _topBorder; }
|
|
set { _topBorder = value; }
|
|
}
|
|
public float BottomBorder
|
|
{
|
|
get { return _bottomBorder; }
|
|
set { _bottomBorder = value; }
|
|
}
|
|
|
|
public static IContainer _top;
|
|
public static IContainer _bottom;
|
|
public static IContainer _left;
|
|
public static IContainer _right;
|
|
|
|
public IContainer Top
|
|
{
|
|
get { return _top; }
|
|
set { }
|
|
}
|
|
public IContainer Bottom
|
|
{
|
|
get { return _bottom; }
|
|
set { }
|
|
}
|
|
public IContainer Left
|
|
{
|
|
get { return _left; }
|
|
set { }
|
|
}
|
|
public IContainer Right
|
|
{
|
|
get { return _right; }
|
|
set { }
|
|
}
|
|
|
|
public EntityContainer(float top,float bottom,float left,float right)
|
|
{
|
|
_topBorder = top;
|
|
_bottomBorder = bottom;
|
|
_leftBorder = left;
|
|
_rightBorder = right;
|
|
this._amountCounter = new Counter<uint>();
|
|
_amountCounter.Value = 0;
|
|
_heading = null;
|
|
}
|
|
|
|
public EntityContainer(IContainer t, IContainer b, IContainer l, IContainer r)
|
|
{
|
|
_top = t;
|
|
_topBorder = t.BottomBorder;
|
|
|
|
_bottom = b;
|
|
_bottomBorder = b.TopBorder;
|
|
|
|
_left= l;
|
|
_leftBorder = l.RightBorder;
|
|
|
|
_right = r;
|
|
_rightBorder = r.LeftBorder;
|
|
}
|
|
|
|
//What should a container do on each rendering frame
|
|
//This method should be overriden
|
|
public void OnRender()
|
|
{
|
|
//坐标刷新
|
|
//边界判定
|
|
//碰撞判定
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|