Daily uodate on 20221105 by nitload youmu
This commit is contained in:
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
@@ -28,7 +28,7 @@ namespace StgSharp.Control
|
||||
/// <param name="point"></param>
|
||||
public static void Bullet(IPoint point)
|
||||
{
|
||||
BulletPool.mainContainer.Add(new Bullet(point));
|
||||
Pool.bulletContainer.Add(new Bullet(point));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -39,7 +39,7 @@ namespace StgSharp.Control
|
||||
/// <param name="end">终点序号</param>
|
||||
public static void Bullet(int begin, int end)
|
||||
{
|
||||
cache = PointPool.mainCotainer.Ending;
|
||||
cache = Pool.pointContainer.Ending;
|
||||
for (int i = 1; i < begin; i++)
|
||||
{
|
||||
cache--;
|
||||
@@ -47,7 +47,7 @@ namespace StgSharp.Control
|
||||
for (int i = begin; i < end; i++)
|
||||
{
|
||||
cache--;
|
||||
BulletPool.mainContainer.Add(new Bullet(cache as IPoint));
|
||||
Pool.bulletContainer.Add(new Bullet(cache as IPoint));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace StgSharp.Control
|
||||
/// <param name="angle"></param>
|
||||
public static void Bullet(int order,uint count,float angle)
|
||||
{
|
||||
cache=PointPool.mainCotainer.Ending;
|
||||
cache=Pool.pointContainer.Ending;
|
||||
for (int i = 1; i < count; i++)
|
||||
{
|
||||
cache--;
|
||||
@@ -68,8 +68,8 @@ namespace StgSharp.Control
|
||||
for (uint i = 0; i < count; i++)
|
||||
{
|
||||
PointOnCircle p = new PointOnCircle(cache as Circle, angle, i);
|
||||
PointPool.mainCotainer.Add(p);
|
||||
BulletPool.mainContainer.Add(new Bullet(p));
|
||||
Pool.pointContainer.Add(p);
|
||||
Pool.bulletContainer.Add(new Bullet(p));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -79,7 +79,7 @@ namespace StgSharp.Control
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 创建一个简单点,并设置其
|
||||
/// 创建一个简单点,并设置其速度和初始角度
|
||||
/// </summary>
|
||||
/// <param name="beginX"></param>
|
||||
/// <param name="beginY"></param>
|
||||
@@ -91,8 +91,13 @@ namespace StgSharp.Control
|
||||
PointCommon p = new PointCommon(beginX, beginY, angle,Pool.tickCounter);
|
||||
p.XVelocity = x;
|
||||
p.YVelocity = y;
|
||||
PointPool.mainCotainer.Add(p);
|
||||
Pool.pointPool.mainCotainer.Add(p);
|
||||
}
|
||||
|
||||
|
||||
public static void Circle(IPoint c, float r)
|
||||
{
|
||||
Pool.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,12 +24,18 @@ namespace StgSharp.Control
|
||||
= new Collector(side.right,600);
|
||||
|
||||
|
||||
internal static IPool pointPool
|
||||
= new PointPool(topCollector,bottomCollector,leftCollector,rightCollector) ;
|
||||
internal static IContainer entityContainer
|
||||
= new EntityContainer(topCollector,bottomCollector,leftCollector,rightCollector) ;
|
||||
|
||||
internal static IPool bulletPool
|
||||
= new BulletPool(topCollector, bottomCollector, leftCollector, rightCollector);
|
||||
internal static IContainer bulletContainer
|
||||
= new EntityContainer(topCollector, bottomCollector, leftCollector, rightCollector);
|
||||
|
||||
internal static IContainer geometryContainer
|
||||
= new GeometryContainer(topCollector, bottomCollector, leftCollector, rightCollector) ;
|
||||
|
||||
internal static IContainer pointContainer
|
||||
= new PointContainer(topCollector, bottomCollector, leftCollector, rightCollector) ;
|
||||
|
||||
static Pool()
|
||||
{
|
||||
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
using StgSharp.Logic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Pool
|
||||
{
|
||||
public interface IPool
|
||||
{
|
||||
IContainer TopCollector { get; }
|
||||
IContainer BottomCollector { get; }
|
||||
IContainer LeftCollector { get; }
|
||||
IContainer RightCollector { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,126 +0,0 @@
|
||||
using StgSharp.Entity;
|
||||
using StgSharp.Logic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Pool
|
||||
{
|
||||
public class BulletPool:IPool
|
||||
{
|
||||
|
||||
internal static IContainer _topCollector;
|
||||
internal static IContainer _bottomCollector;
|
||||
internal static IContainer _leftCollector;
|
||||
internal static IContainer _rightCollector;
|
||||
|
||||
public IContainer TopCollector
|
||||
{
|
||||
get { return _topCollector; }
|
||||
}
|
||||
|
||||
public IContainer BottomCollector
|
||||
{
|
||||
get { return _bottomCollector; }
|
||||
}
|
||||
|
||||
public IContainer LeftCollector
|
||||
{
|
||||
get { return _leftCollector; }
|
||||
}
|
||||
|
||||
public IContainer RightCollector
|
||||
{
|
||||
get { return _rightCollector; }
|
||||
}
|
||||
|
||||
|
||||
//用一个实体容器存放各种各样的实体,太不安全了,
|
||||
//写这种代码的人是个大SB。
|
||||
internal static EntityContainer mainContainer;
|
||||
internal static EntityContainer grazeContainer;
|
||||
|
||||
|
||||
public BulletPool(Collector t, Collector b, Collector l, Collector r)
|
||||
{
|
||||
mainContainer = new EntityContainer(1000,-1000,-600,600);
|
||||
|
||||
grazeContainer = new EntityContainer(1000,400,-150,150);
|
||||
|
||||
mainContainer.Top = _topCollector;
|
||||
mainContainer.Bottom = _bottomCollector;
|
||||
mainContainer.Left = _leftCollector;
|
||||
mainContainer.Right = _rightCollector;
|
||||
|
||||
grazeContainer.Top = mainContainer;
|
||||
grazeContainer.Bottom = mainContainer;
|
||||
grazeContainer.Left = mainContainer;
|
||||
grazeContainer.Right = mainContainer;
|
||||
|
||||
_topCollector = t;
|
||||
_bottomCollector = b;
|
||||
_leftCollector = l;
|
||||
_rightCollector = r;
|
||||
}
|
||||
|
||||
protected static Bullet cache;
|
||||
|
||||
public static void OnRender()
|
||||
{
|
||||
Bullet end=grazeContainer.Ending as Bullet;
|
||||
if (end != null)
|
||||
{
|
||||
cache = grazeContainer.Heading as Bullet;
|
||||
do
|
||||
{
|
||||
if ( cache.X + cache.Radius < grazeContainer.LeftBorder
|
||||
|| cache.X - cache.Radius < grazeContainer.RightBorder
|
||||
|| cache.Y + cache.Radius < grazeContainer.TopBorder
|
||||
|| cache.Y - cache.Radius < grazeContainer.RightBorder)
|
||||
{
|
||||
grazeContainer.Remove(cache);
|
||||
}
|
||||
|
||||
cache = cache.Next as Bullet;
|
||||
|
||||
} while (true);
|
||||
}
|
||||
|
||||
|
||||
end=mainContainer.Ending as Bullet;
|
||||
if (end != null)
|
||||
{
|
||||
|
||||
cache = mainContainer.Heading as Bullet;
|
||||
do
|
||||
{
|
||||
if (cache.X - cache.Radius < grazeContainer.LeftBorder
|
||||
|| cache.X + cache.Radius < grazeContainer.RightBorder
|
||||
|| cache.Y - cache.Radius < grazeContainer.TopBorder
|
||||
|| cache.Y + cache.Radius < grazeContainer.RightBorder)
|
||||
{
|
||||
grazeContainer.Add(cache);
|
||||
}
|
||||
|
||||
cache = cache.Next as Bullet;
|
||||
|
||||
} while (cache == end);
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 所有需要添加的功能应当写在这里
|
||||
/// </summary>
|
||||
public virtual void ExtendRender()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -82,9 +82,17 @@ namespace StgSharp.Logic
|
||||
set { _limit = value; }
|
||||
}
|
||||
|
||||
public GeometryContainer()
|
||||
public GeometryContainer(IContainer t, IContainer b, IContainer l, IContainer r)
|
||||
{
|
||||
_top = t;
|
||||
_bottom = b;
|
||||
_left = l;
|
||||
_right = r;
|
||||
|
||||
_topBorder=t.BottomBorder;
|
||||
_bottomBorder=b.TopBorder;
|
||||
_leftBorder=l.RightBorder;
|
||||
_rightBorder=r.LeftBorder;
|
||||
}
|
||||
|
||||
public void OnRender()
|
||||
|
||||
@@ -80,6 +80,14 @@ namespace StgSharp.Logic
|
||||
_leftBorder = left;
|
||||
_rightBorder = right;
|
||||
}
|
||||
|
||||
public PointContainer(IContainer t,IContainer b,IContainer l,IContainer r)
|
||||
{
|
||||
_top = t;
|
||||
_bottom = b;
|
||||
_left = l;
|
||||
_right = r;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
using StgSharp.Logic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Pool
|
||||
{
|
||||
internal class PointPool:IPool
|
||||
{
|
||||
public static IContainer _topContainer;
|
||||
public static IContainer _bottomContainer;
|
||||
public static IContainer _leftContainer;
|
||||
public static IContainer _rightContainer;
|
||||
|
||||
public IContainer TopCollector
|
||||
{
|
||||
get { return _topContainer; }
|
||||
}
|
||||
|
||||
public IContainer BottomCollector
|
||||
{
|
||||
get { return _bottomContainer; }
|
||||
}
|
||||
|
||||
public IContainer LeftCollector
|
||||
{
|
||||
get { return _leftContainer; }
|
||||
}
|
||||
|
||||
public IContainer RightCollector
|
||||
{
|
||||
get { return _rightContainer; }
|
||||
}
|
||||
|
||||
public static EntityContainer mainCotainer
|
||||
= new EntityContainer(1000,-1000,-600,600);
|
||||
|
||||
public PointPool(Collector t, Collector b, Collector l, Collector r)
|
||||
{
|
||||
_topContainer= t;
|
||||
_bottomContainer= b;
|
||||
_leftContainer= l;
|
||||
_rightContainer= r;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -57,11 +57,8 @@
|
||||
<Compile Include="Geometry\IPoint.cs" />
|
||||
<Compile Include="Geometry\PointCommon.cs" />
|
||||
<Compile Include="Logic\IContainer.cs" />
|
||||
<Compile Include="Pool\BulletPool.cs" />
|
||||
<Compile Include="Pool\Collector.cs" />
|
||||
<Compile Include="Pool\PointContainer.cs" />
|
||||
<Compile Include="Pool\PointPool.cs" />
|
||||
<Compile Include="Logic\IPool.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Entity\Bullet.cs" />
|
||||
<Compile Include="Entity\Player.cs" />
|
||||
|
||||
BIN
Binary file not shown.
Reference in New Issue
Block a user