daily update on 20230301 by nitload youmu, file struct cahnged and more vec func added

This commit is contained in:
Nitload
2023-03-02 01:30:46 +08:00
parent d09105c9c1
commit bb71567e51
594 changed files with 368 additions and 2601 deletions
+20
View File
@@ -0,0 +1,20 @@
using StgSharp.Math;
using System;
using System.Collections.Generic;
using System.Text;
namespace StgSharp
{
public interface IEntity:INode
{
public IGeometry CollisionBox { get; set; }
public Sensor CollisionSensor { get; set; }
public string Texture { get; set; }
public Vec2D Location { get; }
public void SetLocation(Point p);
}
}
+17
View File
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace StgSharp
{
public class Launcher
{
internal Partical _bullet;
public Partical Bullet
{
get { return _bullet; }
set { _bullet = value; }
}
}
}
+47
View File
@@ -0,0 +1,47 @@
using StgSharp.Math;
using System;
using System.Collections.Generic;
using System.Text;
namespace StgSharp
{
public class Partical : IEntity
{
internal IGeometry _collisionBox;
internal Sensor _collisionSensor;
internal string _texture;
internal Vec2D _position;
IGeometry IEntity.CollisionBox
{
get { return _collisionBox; }
set { _collisionBox = value; }
}
Sensor IEntity.CollisionSensor
{
get { return _collisionSensor; }
set { _collisionSensor = value; }
}
string IEntity.Texture
{
get { return _texture; }
set { _texture = value; }
}
Vec2D IEntity.Location
{
get { return _position; }
}
ContainerNode<INode> INode.ID => throw new NotImplementedException();
void INode.setID<T>(ContainerNode<T> id)
{
throw new NotImplementedException();
}
void IEntity.SetLocation(StgSharp.Point p)
{
this._position = p._position;
}
}
}
+62
View File
@@ -0,0 +1,62 @@
using StgSharp.Math;
using System;
using System.Collections.Generic;
using System.Text;
namespace StgSharp
{
public class Player : IEntity
{
internal IGeometry _collisionBox;
internal Sensor _collisionSensor;
internal string _texture;
internal Vec2D _position;
private ContainerNode<INode> _id;
IGeometry IEntity.CollisionBox
{
get { return this._collisionBox; }
set { this._collisionBox = value; }
}
Sensor IEntity.CollisionSensor
{
get { return this._collisionSensor; }
set { this._collisionSensor = value; }
}
string IEntity.Texture
{
get { return this._texture; }
set { this._texture = value; }
}
Vec2D IEntity.Location
{
get { return this._position; }
}
ContainerNode<INode> INode.ID
{
get { return _id; }
}
public void SetLocation(Point p)
{
throw new NotImplementedException();
}
void INode.setID<T>(ContainerNode<T> id)
{
if (id == null)
{
_id = id as ContainerNode<INode>;
}
else
{
throw new ArgumentException("Cannot set id twice!");
}
}
}
}