daily update on 20241002 by nitload youmu, intrinsic function rebuild, syntax style arrange
This commit is contained in:
@@ -30,8 +30,5 @@
|
||||
//-----------------------------------------------------------------------
|
||||
namespace StgSharp.Entities
|
||||
{
|
||||
public abstract class BehaviorArgs
|
||||
{
|
||||
|
||||
}
|
||||
public abstract class BehaviorArgs { }
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -43,9 +42,23 @@ namespace StgSharp.Entities
|
||||
internal LinkedList<Launcher<EntityPartical>> _commonBulletLauncher;
|
||||
public bool _selectalbe;
|
||||
|
||||
public Launcher<EntityPartical> AwardLauncher { get; set; }
|
||||
public Launcher<EntityPartical> DieBulletLauncher { get; set; }
|
||||
public LinkedList<Launcher<EntityPartical>> CommonBulletLauncher { get; set; }
|
||||
public Launcher<EntityPartical> AwardLauncher
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public Launcher<EntityPartical> DieBulletLauncher
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public LinkedList<Launcher<EntityPartical>> CommonBulletLauncher
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public virtual void OnRender()
|
||||
{
|
||||
@@ -55,8 +68,7 @@ namespace StgSharp.Entities
|
||||
public override void OnRenderFrame()
|
||||
{
|
||||
this.OnUpdate();
|
||||
foreach (Launcher<EntityPartical> launcher in CommonBulletLauncher)
|
||||
{
|
||||
foreach( Launcher<EntityPartical> launcher in CommonBulletLauncher ) {
|
||||
launcher.Launch();
|
||||
}
|
||||
this.OnRender();
|
||||
@@ -67,6 +79,5 @@ namespace StgSharp.Entities
|
||||
new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -29,7 +29,6 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace StgSharp.Entities
|
||||
{
|
||||
public class Enemy : IEntity
|
||||
@@ -40,15 +39,28 @@ namespace StgSharp.Entities
|
||||
internal Launcher<EntityPartical> _dieBulletLauncher;
|
||||
public bool _selectalbe;
|
||||
|
||||
public Launcher<EntityPartical> AwardLauncher { get; set; }
|
||||
public Launcher<EntityPartical> CommonBulletLauncher { get; set; }
|
||||
public Launcher<EntityPartical> DieBulletLauncher { get; set; }
|
||||
public Launcher<EntityPartical> AwardLauncher
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public Launcher<EntityPartical> CommonBulletLauncher
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public Launcher<EntityPartical> DieBulletLauncher
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public override void OnRenderFrame()
|
||||
{
|
||||
CommonBulletLauncher.Launch();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,8 +30,5 @@
|
||||
//-----------------------------------------------------------------------
|
||||
namespace StgSharp.Entities
|
||||
{
|
||||
public abstract class EntityPartical : IEntity
|
||||
{
|
||||
|
||||
}
|
||||
public abstract class EntityPartical : IEntity { }
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace StgSharp
|
||||
{
|
||||
|
||||
protected uint _bornTick;
|
||||
internal Func<int, vec3d> _movHandler;
|
||||
internal Func<int, Vec3> _movHandler;
|
||||
internal LinkedList<PlainGeometry> _collisionBox;
|
||||
internal Point _basePoint;
|
||||
internal Point _pos;
|
||||
@@ -51,12 +51,20 @@ namespace StgSharp
|
||||
/// <summary>
|
||||
/// X position of an enenmy entity
|
||||
/// </summary>
|
||||
public float X { get; set; }
|
||||
public float X
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Y position of an enemy entity
|
||||
/// </summary>
|
||||
public float Y { get; set; }
|
||||
public float Y
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public LinkedList<PlainGeometry> CollisionBox
|
||||
{
|
||||
@@ -73,16 +81,24 @@ namespace StgSharp
|
||||
set => _collisionSensor = value;
|
||||
}
|
||||
|
||||
public string TextureGL { get; set; }
|
||||
public string TextureGL
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A 2D vector presenting the position of an enemy entity, position can also be visited by X, Y
|
||||
/// A 2D vector presenting the position of an enemy entity, position can also be visited by
|
||||
/// X, Y
|
||||
/// </summary>
|
||||
public vec2d Location { get; }
|
||||
public Vec2 Location
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
public abstract void OnRenderFrame();
|
||||
|
||||
public void SetLocation(Point p)
|
||||
public void SetLocation( Point p )
|
||||
{
|
||||
_pos = p;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ using StgSharp.Math;
|
||||
|
||||
namespace StgSharp
|
||||
{
|
||||
public class Launcher<T> where T : IEntity
|
||||
public class Launcher<T> where T: IEntity
|
||||
{
|
||||
|
||||
internal uint[] launchtick; //发射子弹的内部计时
|
||||
@@ -44,7 +44,7 @@ namespace StgSharp
|
||||
*用于发射其他的实体,主要是子弹 和 掉落物
|
||||
*/
|
||||
|
||||
internal vec2d _center; //发射器的参考位置,运动轨迹的方程应当基于这个参考点构建
|
||||
internal Vec2 _center; //发射器的参考位置,运动轨迹的方程应当基于这个参考点构建
|
||||
|
||||
public EntityPartical Bullet
|
||||
{
|
||||
@@ -52,12 +52,7 @@ namespace StgSharp
|
||||
set => _bulletSample = value;
|
||||
}
|
||||
|
||||
internal virtual void Launch()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
internal virtual void Launch() { }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,5 @@ namespace StgSharp
|
||||
|
||||
public float Velocity => _velocity;
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user