no more windows??
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
<Platforms>AnyCPU</Platforms>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<LangVersion>10.0</LangVersion>
|
||||
<LangVersion>9.0</LangVersion>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
namespace System.Diagnostics.CodeAnalysis;
|
||||
|
||||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter)]
|
||||
internal sealed class AllowNullAttribute : Attribute
|
||||
namespace System.Diagnostics.CodeAnalysis
|
||||
{
|
||||
|
||||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter)]
|
||||
internal sealed class AllowNullAttribute : Attribute
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,12 +1,13 @@
|
||||
namespace System.Diagnostics.CodeAnalysis;
|
||||
|
||||
[AttributeUsage(AttributeTargets.Parameter)]
|
||||
internal class DoesNotReturnIfAttribute : Attribute
|
||||
namespace System.Diagnostics.CodeAnalysis
|
||||
{
|
||||
public DoesNotReturnIfAttribute(bool parameterValue)
|
||||
[AttributeUsage(AttributeTargets.Parameter)]
|
||||
internal class DoesNotReturnIfAttribute : Attribute
|
||||
{
|
||||
ParameterValue = parameterValue;
|
||||
}
|
||||
public DoesNotReturnIfAttribute(bool parameterValue)
|
||||
{
|
||||
ParameterValue = parameterValue;
|
||||
}
|
||||
|
||||
public bool ParameterValue { get; }
|
||||
public bool ParameterValue { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
namespace System.Diagnostics.CodeAnalysis;
|
||||
|
||||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter |
|
||||
AttributeTargets.ReturnValue)]
|
||||
internal sealed class MaybeNullAttribute : Attribute
|
||||
namespace System.Diagnostics.CodeAnalysis
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter |
|
||||
AttributeTargets.ReturnValue)]
|
||||
internal sealed class MaybeNullAttribute : Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,9 @@
|
||||
namespace System.Diagnostics.CodeAnalysis;
|
||||
|
||||
[AttributeUsage(
|
||||
AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter |
|
||||
AttributeTargets.ReturnValue, AllowMultiple = true)]
|
||||
internal sealed class NotNullAttribute : Attribute
|
||||
namespace System.Diagnostics.CodeAnalysis
|
||||
{
|
||||
[AttributeUsage(
|
||||
AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter |
|
||||
AttributeTargets.ReturnValue, AllowMultiple = true)]
|
||||
internal sealed class NotNullAttribute : Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,13 @@
|
||||
namespace System.Diagnostics.CodeAnalysis;
|
||||
|
||||
[AttributeUsage(AttributeTargets.Parameter)]
|
||||
internal sealed class NotNullWhenAttribute : Attribute
|
||||
namespace System.Diagnostics.CodeAnalysis
|
||||
{
|
||||
public NotNullWhenAttribute(bool returnValue)
|
||||
[AttributeUsage(AttributeTargets.Parameter)]
|
||||
internal sealed class NotNullWhenAttribute : Attribute
|
||||
{
|
||||
ReturnValue = returnValue;
|
||||
}
|
||||
public NotNullWhenAttribute(bool returnValue)
|
||||
{
|
||||
ReturnValue = returnValue;
|
||||
}
|
||||
|
||||
public bool ReturnValue { get; }
|
||||
public bool ReturnValue { get; }
|
||||
}
|
||||
}
|
||||
@@ -2,200 +2,201 @@ using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Drawing.Imaging;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
public class Are : Rect
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
public Bitmap Dis;
|
||||
|
||||
protected Graphics gd;
|
||||
|
||||
protected Bitmap Hit;
|
||||
|
||||
protected Graphics gh;
|
||||
|
||||
protected double unit;
|
||||
|
||||
protected double disUnit;
|
||||
|
||||
protected double hitUnit;
|
||||
|
||||
protected Size WH = System.Drawing.Size.Empty;
|
||||
|
||||
protected Size WHH = System.Drawing.Size.Empty;
|
||||
|
||||
protected Size WHA = System.Drawing.Size.Empty;
|
||||
|
||||
private Color ClearColor = Color.Transparent;
|
||||
|
||||
public Vector2D BasePoint = Dat.Vec2DZero;
|
||||
|
||||
public Vector2D Position = Dat.Vec2DZero;
|
||||
|
||||
protected Vector2D p;
|
||||
|
||||
protected Rectangle r;
|
||||
|
||||
protected ColorMatrix cm = new ColorMatrix();
|
||||
|
||||
protected ImageAttributes ia = new ImageAttributes();
|
||||
|
||||
protected InterpolationMode im;
|
||||
|
||||
public Graphics GD => gd;
|
||||
|
||||
public Graphics GH => gh;
|
||||
|
||||
public double Unit => unit;
|
||||
|
||||
public double DisUnit => disUnit;
|
||||
|
||||
public Are() { }
|
||||
public Are(double Unit, double XRatio, double YRatio, double Size, double DisMag, double HitMag)
|
||||
{
|
||||
Setting(Unit, XRatio, YRatio, Size, DisMag, HitMag);
|
||||
}
|
||||
|
||||
public Are(Med Med, bool Hit)
|
||||
{
|
||||
if (Hit)
|
||||
{
|
||||
Setting(Med.Unit, Med.Base.XRatio, Med.Base.YRatio, Med.Base.Size, Med.DisQuality, Med.HitAccuracy);
|
||||
}
|
||||
else
|
||||
{
|
||||
Setting(Med.Unit, Med.Base.XRatio, Med.Base.YRatio, Med.Base.Size, Med.DisQuality);
|
||||
}
|
||||
}
|
||||
private void Setting(double Unit, double XRatio, double YRatio, double Size, double DisMag)
|
||||
public class Are : Rect
|
||||
{
|
||||
SetXYRatio(XRatio, YRatio);
|
||||
base.Size = Size;
|
||||
unit = Unit;
|
||||
disUnit = Unit * DisMag;
|
||||
WH.Width = (int)(base.LocalWidth * Unit);
|
||||
WH.Height = (int)(base.LocalHeight * Unit);
|
||||
WHA.Width = (int)(base.LocalWidth * disUnit);
|
||||
WHA.Height = (int)(base.LocalHeight * disUnit);
|
||||
Dis = new Bitmap((int)((double)WH.Width * DisMag), (int)((double)WH.Height * DisMag));
|
||||
gd = Graphics.FromImage(Dis);
|
||||
public Bitmap Dis;
|
||||
|
||||
protected Graphics gd;
|
||||
|
||||
protected Bitmap Hit;
|
||||
|
||||
protected Graphics gh;
|
||||
|
||||
protected double unit;
|
||||
|
||||
protected double disUnit;
|
||||
|
||||
protected double hitUnit;
|
||||
|
||||
protected Size WH = System.Drawing.Size.Empty;
|
||||
|
||||
protected Size WHH = System.Drawing.Size.Empty;
|
||||
|
||||
protected Size WHA = System.Drawing.Size.Empty;
|
||||
|
||||
private Color ClearColor = Color.Transparent;
|
||||
|
||||
public Vector2D BasePoint = Dat.Vec2DZero;
|
||||
|
||||
public Vector2D Position = Dat.Vec2DZero;
|
||||
|
||||
protected Vector2D p;
|
||||
|
||||
protected Rectangle r;
|
||||
|
||||
protected ColorMatrix cm = new ColorMatrix();
|
||||
|
||||
protected ImageAttributes ia = new ImageAttributes();
|
||||
|
||||
protected InterpolationMode im;
|
||||
|
||||
public Graphics GD => gd;
|
||||
|
||||
public Graphics GH => gh;
|
||||
|
||||
public double Unit => unit;
|
||||
|
||||
public double DisUnit => disUnit;
|
||||
|
||||
public Are() { }
|
||||
public Are(double Unit, double XRatio, double YRatio, double Size, double DisMag, double HitMag)
|
||||
{
|
||||
Setting(Unit, XRatio, YRatio, Size, DisMag, HitMag);
|
||||
}
|
||||
|
||||
public Are(Med Med, bool Hit)
|
||||
{
|
||||
if (Hit)
|
||||
{
|
||||
Setting(Med.Unit, Med.Base.XRatio, Med.Base.YRatio, Med.Base.Size, Med.DisQuality, Med.HitAccuracy);
|
||||
}
|
||||
else
|
||||
{
|
||||
Setting(Med.Unit, Med.Base.XRatio, Med.Base.YRatio, Med.Base.Size, Med.DisQuality);
|
||||
}
|
||||
}
|
||||
private void Setting(double Unit, double XRatio, double YRatio, double Size, double DisMag)
|
||||
{
|
||||
SetXYRatio(XRatio, YRatio);
|
||||
base.Size = Size;
|
||||
unit = Unit;
|
||||
disUnit = Unit * DisMag;
|
||||
WH.Width = (int)(base.LocalWidth * Unit);
|
||||
WH.Height = (int)(base.LocalHeight * Unit);
|
||||
WHA.Width = (int)(base.LocalWidth * disUnit);
|
||||
WHA.Height = (int)(base.LocalHeight * disUnit);
|
||||
Dis = new Bitmap((int)((double)WH.Width * DisMag), (int)((double)WH.Height * DisMag));
|
||||
gd = Graphics.FromImage(Dis);
|
||||
|
||||
|
||||
gd.SmoothingMode = SmoothingMode.None;
|
||||
gd.PixelOffsetMode = PixelOffsetMode.HighSpeed;
|
||||
gd.InterpolationMode = InterpolationMode.NearestNeighbor;
|
||||
//needed for text or smthn
|
||||
gd.CompositingMode = CompositingMode.SourceOver;
|
||||
gd.SmoothingMode = SmoothingMode.None;
|
||||
gd.PixelOffsetMode = PixelOffsetMode.HighSpeed;
|
||||
gd.InterpolationMode = InterpolationMode.NearestNeighbor;
|
||||
//needed for text or smthn
|
||||
gd.CompositingMode = CompositingMode.SourceOver;
|
||||
}
|
||||
private void Setting(double Unit, double XRatio, double YRatio, double Size, double DisMag, double HitMag)
|
||||
{
|
||||
Setting(Unit, XRatio, YRatio, Size, DisMag);
|
||||
|
||||
hitUnit = Unit * HitMag;
|
||||
WHH.Width = (int)(base.LocalWidth * hitUnit);
|
||||
WHH.Height = (int)(base.LocalHeight * hitUnit);
|
||||
Hit = new Bitmap(WHH.Width, WHH.Height);
|
||||
gh = Graphics.FromImage(Hit);
|
||||
|
||||
|
||||
gh.SmoothingMode = SmoothingMode.None;
|
||||
gh.PixelOffsetMode = PixelOffsetMode.HighSpeed;
|
||||
gh.InterpolationMode = InterpolationMode.NearestNeighbor;
|
||||
gh.CompositingMode = CompositingMode.SourceCopy;
|
||||
}
|
||||
|
||||
public Vector2D GetPosition()
|
||||
{
|
||||
return new Vector2D(Position.X - BasePoint.X * XRatio * Size, Position.Y - BasePoint.Y * YRatio * Size);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public void Draw(Par Par)
|
||||
{
|
||||
Par.Draw(disUnit, gd);
|
||||
if (gh != null)
|
||||
{
|
||||
Par.DrawH(hitUnit, gh);
|
||||
}
|
||||
}
|
||||
|
||||
public void Draw(ParT ParT)
|
||||
{
|
||||
ParT.Draw(disUnit, gd);
|
||||
if (gh != null)
|
||||
{
|
||||
ParT.DrawH(hitUnit, gh);
|
||||
}
|
||||
}
|
||||
|
||||
public void Draw(Pars Pars)
|
||||
{
|
||||
Pars.Draw(disUnit, gd);
|
||||
if (gh != null)
|
||||
{
|
||||
Pars.DrawH(hitUnit, gh);
|
||||
}
|
||||
}
|
||||
|
||||
public void Draw(Graphics GD)
|
||||
{
|
||||
p = GetPosition();
|
||||
GD.DrawImage(Dis, (int)(p.X * unit), (int)(p.Y * unit), WH.Width, WH.Height);
|
||||
}
|
||||
|
||||
public void Draw(Graphics GD, Graphics GH)
|
||||
{
|
||||
p = GetPosition();
|
||||
GD.DrawImage(Dis, (int)(p.X * unit), (int)(p.Y * unit), WH.Width, WH.Height);
|
||||
if (gh != null)
|
||||
{
|
||||
GH.DrawImage(Hit, (int)(p.X * hitUnit), (int)(p.Y * hitUnit), WHH.Width, WHH.Height);
|
||||
}
|
||||
}
|
||||
|
||||
public void Draw(Are Are)
|
||||
{
|
||||
p = Are.GetPosition();
|
||||
GD.DrawImage(Are.Dis, (float)(p.X * Are.disUnit), (float)(p.Y * Are.disUnit), Are.WHA.Width, Are.WHA.Height);
|
||||
if (Are.gh != null && GH != null)
|
||||
{
|
||||
GH.DrawImage(Are.Hit, (int)(p.X * Are.hitUnit), (int)(p.Y * Are.hitUnit), Are.WHH.Width, Are.WHH.Height);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
gd.Clear(ClearColor);
|
||||
if (gh != null)
|
||||
{
|
||||
gh.Clear(ClearColor);
|
||||
}
|
||||
}
|
||||
|
||||
public void Clear(Color Color)
|
||||
{
|
||||
gd.Clear(Color);
|
||||
if (gh != null)
|
||||
{
|
||||
gh.Clear(ClearColor);
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Dis.Dispose();
|
||||
gd.Dispose();
|
||||
if (Hit != null)
|
||||
{
|
||||
Hit.Dispose();
|
||||
gh.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
private void Setting(double Unit, double XRatio, double YRatio, double Size, double DisMag, double HitMag)
|
||||
{
|
||||
Setting(Unit, XRatio, YRatio, Size, DisMag);
|
||||
|
||||
hitUnit = Unit * HitMag;
|
||||
WHH.Width = (int)(base.LocalWidth * hitUnit);
|
||||
WHH.Height = (int)(base.LocalHeight * hitUnit);
|
||||
Hit = new Bitmap(WHH.Width, WHH.Height);
|
||||
gh = Graphics.FromImage(Hit);
|
||||
|
||||
|
||||
gh.SmoothingMode = SmoothingMode.None;
|
||||
gh.PixelOffsetMode = PixelOffsetMode.HighSpeed;
|
||||
gh.InterpolationMode = InterpolationMode.NearestNeighbor;
|
||||
gh.CompositingMode = CompositingMode.SourceCopy;
|
||||
}
|
||||
|
||||
public Vector2D GetPosition()
|
||||
{
|
||||
return new Vector2D(Position.X - BasePoint.X * XRatio * Size, Position.Y - BasePoint.Y * YRatio * Size);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public void Draw(Par Par)
|
||||
{
|
||||
Par.Draw(disUnit, gd);
|
||||
if (gh != null)
|
||||
{
|
||||
Par.DrawH(hitUnit, gh);
|
||||
}
|
||||
}
|
||||
|
||||
public void Draw(ParT ParT)
|
||||
{
|
||||
ParT.Draw(disUnit, gd);
|
||||
if (gh != null)
|
||||
{
|
||||
ParT.DrawH(hitUnit, gh);
|
||||
}
|
||||
}
|
||||
|
||||
public void Draw(Pars Pars)
|
||||
{
|
||||
Pars.Draw(disUnit, gd);
|
||||
if (gh != null)
|
||||
{
|
||||
Pars.DrawH(hitUnit, gh);
|
||||
}
|
||||
}
|
||||
|
||||
public void Draw(Graphics GD)
|
||||
{
|
||||
p = GetPosition();
|
||||
GD.DrawImage(Dis, (int)(p.X * unit), (int)(p.Y * unit), WH.Width, WH.Height);
|
||||
}
|
||||
|
||||
public void Draw(Graphics GD, Graphics GH)
|
||||
{
|
||||
p = GetPosition();
|
||||
GD.DrawImage(Dis, (int)(p.X * unit), (int)(p.Y * unit), WH.Width, WH.Height);
|
||||
if (gh != null)
|
||||
{
|
||||
GH.DrawImage(Hit, (int)(p.X * hitUnit), (int)(p.Y * hitUnit), WHH.Width, WHH.Height);
|
||||
}
|
||||
}
|
||||
|
||||
public void Draw(Are Are)
|
||||
{
|
||||
p = Are.GetPosition();
|
||||
GD.DrawImage(Are.Dis, (float)(p.X * Are.disUnit), (float)(p.Y * Are.disUnit), Are.WHA.Width, Are.WHA.Height);
|
||||
if (Are.gh != null && GH != null)
|
||||
{
|
||||
GH.DrawImage(Are.Hit, (int)(p.X * Are.hitUnit), (int)(p.Y * Are.hitUnit), Are.WHH.Width, Are.WHH.Height);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
gd.Clear(ClearColor);
|
||||
if (gh != null)
|
||||
{
|
||||
gh.Clear(ClearColor);
|
||||
}
|
||||
}
|
||||
|
||||
public void Clear(Color Color)
|
||||
{
|
||||
gd.Clear(Color);
|
||||
if (gh != null)
|
||||
{
|
||||
gh.Clear(ClearColor);
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Dis.Dispose();
|
||||
gd.Dispose();
|
||||
if (Hit != null)
|
||||
{
|
||||
Hit.Dispose();
|
||||
gh.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,84 +1,85 @@
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
public class AreM : Are
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
private double strength;
|
||||
public class AreM : Are
|
||||
{
|
||||
private double strength;
|
||||
|
||||
private double unitS;
|
||||
private double unitS;
|
||||
|
||||
public AreM(double Unit, double XRatio, double YRatio, double Size, double DisMag, double HitMag, double Strength)
|
||||
{
|
||||
Setting(Unit, XRatio, YRatio, Size, DisMag, HitMag, Strength);
|
||||
}
|
||||
public AreM(double Unit, double XRatio, double YRatio, double Size, double DisMag, double HitMag, double Strength)
|
||||
{
|
||||
Setting(Unit, XRatio, YRatio, Size, DisMag, HitMag, Strength);
|
||||
}
|
||||
|
||||
private void Setting(double Unit, double XRatio, double YRatio, double Size, double DisMag, double HitMag, double Strength)
|
||||
{
|
||||
SetXYRatio(XRatio, YRatio);
|
||||
base.Size = Size;
|
||||
unit = Unit;
|
||||
strength = Strength;
|
||||
disUnit = Unit * DisMag;
|
||||
double num = 1.0 - Strength;
|
||||
unitS = disUnit * num;
|
||||
WH.Width = (int)(base.LocalWidth * Unit);
|
||||
WH.Height = (int)(base.LocalHeight * Unit);
|
||||
WHA.Width = (int)(base.LocalWidth * disUnit);
|
||||
WHA.Height = (int)(base.LocalHeight * disUnit);
|
||||
Dis = new Bitmap((int)((double)WH.Width * DisMag * num), (int)((double)WH.Height * DisMag * num));
|
||||
gd = Graphics.FromImage(Dis);
|
||||
gd.SmoothingMode = SmoothingMode.None;
|
||||
gd.PixelOffsetMode = PixelOffsetMode.None;
|
||||
hitUnit = Unit * HitMag;
|
||||
WHH.Width = (int)(base.LocalWidth * hitUnit);
|
||||
WHH.Height = (int)(base.LocalHeight * hitUnit);
|
||||
Hit = new Bitmap(WHH.Width, WHH.Height);
|
||||
gh = Graphics.FromImage(Hit);
|
||||
gh.SmoothingMode = SmoothingMode.None;
|
||||
gh.PixelOffsetMode = PixelOffsetMode.None;
|
||||
}
|
||||
private void Setting(double Unit, double XRatio, double YRatio, double Size, double DisMag, double HitMag, double Strength)
|
||||
{
|
||||
SetXYRatio(XRatio, YRatio);
|
||||
base.Size = Size;
|
||||
unit = Unit;
|
||||
strength = Strength;
|
||||
disUnit = Unit * DisMag;
|
||||
double num = 1.0 - Strength;
|
||||
unitS = disUnit * num;
|
||||
WH.Width = (int)(base.LocalWidth * Unit);
|
||||
WH.Height = (int)(base.LocalHeight * Unit);
|
||||
WHA.Width = (int)(base.LocalWidth * disUnit);
|
||||
WHA.Height = (int)(base.LocalHeight * disUnit);
|
||||
Dis = new Bitmap((int)((double)WH.Width * DisMag * num), (int)((double)WH.Height * DisMag * num));
|
||||
gd = Graphics.FromImage(Dis);
|
||||
gd.SmoothingMode = SmoothingMode.None;
|
||||
gd.PixelOffsetMode = PixelOffsetMode.None;
|
||||
hitUnit = Unit * HitMag;
|
||||
WHH.Width = (int)(base.LocalWidth * hitUnit);
|
||||
WHH.Height = (int)(base.LocalHeight * hitUnit);
|
||||
Hit = new Bitmap(WHH.Width, WHH.Height);
|
||||
gh = Graphics.FromImage(Hit);
|
||||
gh.SmoothingMode = SmoothingMode.None;
|
||||
gh.PixelOffsetMode = PixelOffsetMode.None;
|
||||
}
|
||||
|
||||
public new void Draw(ParT ParT)
|
||||
{
|
||||
ParT.Draw(unitS, gd);
|
||||
if (gh != null)
|
||||
{
|
||||
ParT.DrawH(hitUnit, gh);
|
||||
}
|
||||
}
|
||||
public new void Draw(ParT ParT)
|
||||
{
|
||||
ParT.Draw(unitS, gd);
|
||||
if (gh != null)
|
||||
{
|
||||
ParT.DrawH(hitUnit, gh);
|
||||
}
|
||||
}
|
||||
|
||||
public new void Draw(Pars Pars)
|
||||
{
|
||||
Pars.Draw(unitS, gd);
|
||||
if (gh != null)
|
||||
{
|
||||
Pars.DrawH(hitUnit, gh);
|
||||
}
|
||||
}
|
||||
public new void Draw(Graphics GD)
|
||||
{
|
||||
im = GD.InterpolationMode;
|
||||
GD.InterpolationMode = InterpolationMode.NearestNeighbor;
|
||||
p = GetPosition();
|
||||
GD.DrawImage(Dis, (int)(p.X * unit), (int)(p.Y * unit), WH.Width, WH.Height);
|
||||
GD.InterpolationMode = im;
|
||||
}
|
||||
public new void Draw(Pars Pars)
|
||||
{
|
||||
Pars.Draw(unitS, gd);
|
||||
if (gh != null)
|
||||
{
|
||||
Pars.DrawH(hitUnit, gh);
|
||||
}
|
||||
}
|
||||
public new void Draw(Graphics GD)
|
||||
{
|
||||
im = GD.InterpolationMode;
|
||||
GD.InterpolationMode = InterpolationMode.NearestNeighbor;
|
||||
p = GetPosition();
|
||||
GD.DrawImage(Dis, (int)(p.X * unit), (int)(p.Y * unit), WH.Width, WH.Height);
|
||||
GD.InterpolationMode = im;
|
||||
}
|
||||
|
||||
public new void Draw(Graphics GD, double Opacity)
|
||||
{
|
||||
im = GD.InterpolationMode;
|
||||
GD.InterpolationMode = InterpolationMode.NearestNeighbor;
|
||||
cm.Matrix33 = (float)Opacity;
|
||||
ia.SetColorMatrix(cm);
|
||||
p = GetPosition();
|
||||
r.X = (int)(p.X * unit);
|
||||
r.Y = (int)(p.Y * unit);
|
||||
r.Width = WH.Width;
|
||||
r.Height = WH.Height;
|
||||
GD.DrawImage(Dis, r, 0, 0, Dis.Width, Dis.Height, GraphicsUnit.Pixel, ia);
|
||||
GD.InterpolationMode = im;
|
||||
}
|
||||
public new void Draw(Graphics GD, double Opacity)
|
||||
{
|
||||
im = GD.InterpolationMode;
|
||||
GD.InterpolationMode = InterpolationMode.NearestNeighbor;
|
||||
cm.Matrix33 = (float)Opacity;
|
||||
ia.SetColorMatrix(cm);
|
||||
p = GetPosition();
|
||||
r.X = (int)(p.X * unit);
|
||||
r.Y = (int)(p.Y * unit);
|
||||
r.Width = WH.Width;
|
||||
r.Height = WH.Height;
|
||||
GD.DrawImage(Dis, r, 0, 0, Dis.Width, Dis.Height, GraphicsUnit.Pixel, ia);
|
||||
GD.InterpolationMode = im;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,166 +1,167 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
public class But
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
private bool dra = true;
|
||||
public class But
|
||||
{
|
||||
private bool dra = true;
|
||||
|
||||
private Color hc = Color.Transparent;
|
||||
private Color hc = Color.Transparent;
|
||||
|
||||
protected Pars pars;
|
||||
protected Pars pars;
|
||||
|
||||
protected Action<But> Over = delegate
|
||||
{
|
||||
};
|
||||
protected Action<But> Over = delegate
|
||||
{
|
||||
};
|
||||
|
||||
protected Action<But> Push = delegate
|
||||
{
|
||||
};
|
||||
protected Action<But> Push = delegate
|
||||
{
|
||||
};
|
||||
|
||||
protected Action<But> Release = delegate
|
||||
{
|
||||
};
|
||||
protected Action<But> Release = delegate
|
||||
{
|
||||
};
|
||||
|
||||
protected Action<But> Out = delegate
|
||||
{
|
||||
};
|
||||
protected Action<But> Out = delegate
|
||||
{
|
||||
};
|
||||
|
||||
public Action<But> Action = delegate
|
||||
{
|
||||
};
|
||||
public Action<But> Action = delegate
|
||||
{
|
||||
};
|
||||
|
||||
private bool f1;
|
||||
private bool f1;
|
||||
|
||||
private bool f2;
|
||||
private bool f2;
|
||||
|
||||
public bool Dra
|
||||
{
|
||||
get
|
||||
{
|
||||
return dra;
|
||||
}
|
||||
set
|
||||
{
|
||||
Move(ref hc);
|
||||
dra = value;
|
||||
}
|
||||
}
|
||||
public bool Dra
|
||||
{
|
||||
get
|
||||
{
|
||||
return dra;
|
||||
}
|
||||
set
|
||||
{
|
||||
Move(ref hc);
|
||||
dra = value;
|
||||
}
|
||||
}
|
||||
|
||||
public Pars Pars => pars;
|
||||
public Pars Pars => pars;
|
||||
|
||||
public But(Par Par, Action<But> Action)
|
||||
{
|
||||
pars = new Pars(Par);
|
||||
this.Action = Action;
|
||||
}
|
||||
public But(Par Par, Action<But> Action)
|
||||
{
|
||||
pars = new Pars(Par);
|
||||
this.Action = Action;
|
||||
}
|
||||
|
||||
public But(ParT ParT, Action<But> Action)
|
||||
{
|
||||
pars = new Pars(ParT);
|
||||
this.Action = Action;
|
||||
}
|
||||
public But(ParT ParT, Action<But> Action)
|
||||
{
|
||||
pars = new Pars(ParT);
|
||||
this.Action = Action;
|
||||
}
|
||||
|
||||
public But(Pars Pars, Action<But> Action)
|
||||
{
|
||||
pars = Pars;
|
||||
this.Action = Action;
|
||||
}
|
||||
public But(Pars Pars, Action<But> Action)
|
||||
{
|
||||
pars = Pars;
|
||||
this.Action = Action;
|
||||
}
|
||||
|
||||
public bool Move(ref Color HitColor)
|
||||
{
|
||||
if (Dra && !f2 && pars.IsHit(ref HitColor))
|
||||
{
|
||||
f2 = true;
|
||||
Over(this);
|
||||
return true;
|
||||
}
|
||||
if (Dra && f2 && !pars.IsHit(ref HitColor))
|
||||
{
|
||||
f1 = false;
|
||||
f2 = false;
|
||||
Out(this);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public bool Move(ref Color HitColor)
|
||||
{
|
||||
if (Dra && !f2 && pars.IsHit(ref HitColor))
|
||||
{
|
||||
f2 = true;
|
||||
Over(this);
|
||||
return true;
|
||||
}
|
||||
if (Dra && f2 && !pars.IsHit(ref HitColor))
|
||||
{
|
||||
f1 = false;
|
||||
f2 = false;
|
||||
Out(this);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool Leave()
|
||||
{
|
||||
if (Dra && f2)
|
||||
{
|
||||
f1 = false;
|
||||
f2 = false;
|
||||
Out(this);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public bool Leave()
|
||||
{
|
||||
if (Dra && f2)
|
||||
{
|
||||
f1 = false;
|
||||
f2 = false;
|
||||
Out(this);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool Down(ref Color HitColor)
|
||||
{
|
||||
if (Dra && !f1 && pars.IsHit(ref HitColor))
|
||||
{
|
||||
f1 = true;
|
||||
Push(this);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public bool Down(ref Color HitColor)
|
||||
{
|
||||
if (Dra && !f1 && pars.IsHit(ref HitColor))
|
||||
{
|
||||
f1 = true;
|
||||
Push(this);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool Up(ref Color HitColor)
|
||||
{
|
||||
if (Dra && f1 && pars.IsHit(ref HitColor))
|
||||
{
|
||||
f1 = false;
|
||||
Release(this);
|
||||
Action(this);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public bool Up(ref Color HitColor)
|
||||
{
|
||||
if (Dra && f1 && pars.IsHit(ref HitColor))
|
||||
{
|
||||
f1 = false;
|
||||
Release(this);
|
||||
Action(this);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void Draw(Are Are)
|
||||
{
|
||||
if (dra)
|
||||
{
|
||||
Are.Draw(pars);
|
||||
}
|
||||
}
|
||||
public void Draw(Are Are)
|
||||
{
|
||||
if (dra)
|
||||
{
|
||||
Are.Draw(pars);
|
||||
}
|
||||
}
|
||||
|
||||
public void Draw(AreM AreM)
|
||||
{
|
||||
if (dra)
|
||||
{
|
||||
AreM.Draw(pars);
|
||||
}
|
||||
}
|
||||
public void Draw(AreM AreM)
|
||||
{
|
||||
if (dra)
|
||||
{
|
||||
AreM.Draw(pars);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetHitColor(Med Med)
|
||||
{
|
||||
foreach (Par item in pars.EnumAllPar())
|
||||
{
|
||||
if (item.HitColor != Color.Transparent)
|
||||
{
|
||||
Med.RemUniqueColor(item.HitColor);
|
||||
}
|
||||
item.HitColor = Med.GetUniqueColor();
|
||||
}
|
||||
}
|
||||
public void SetHitColor(Med Med)
|
||||
{
|
||||
foreach (Par item in pars.EnumAllPar())
|
||||
{
|
||||
if (item.HitColor != Color.Transparent)
|
||||
{
|
||||
Med.RemUniqueColor(item.HitColor);
|
||||
}
|
||||
item.HitColor = Med.GetUniqueColor();
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
pars.Dispose();
|
||||
}
|
||||
public void Dispose()
|
||||
{
|
||||
pars.Dispose();
|
||||
}
|
||||
|
||||
public bool IsBut1()
|
||||
{
|
||||
return this is But1;
|
||||
}
|
||||
public bool IsBut1()
|
||||
{
|
||||
return this is But1;
|
||||
}
|
||||
|
||||
public But1 ToBut1()
|
||||
{
|
||||
return (But1)this;
|
||||
}
|
||||
public But1 ToBut1()
|
||||
{
|
||||
return (But1)this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,108 +3,109 @@ using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
public class But1 : But
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
public List<Color> BaseColors = new List<Color>();
|
||||
public class But1 : But
|
||||
{
|
||||
public List<Color> BaseColors = new List<Color>();
|
||||
|
||||
public List<Color> OverColors = new List<Color>();
|
||||
public List<Color> OverColors = new List<Color>();
|
||||
|
||||
public List<Color> PushColors = new List<Color>();
|
||||
public List<Color> PushColors = new List<Color>();
|
||||
|
||||
public List<Color> TextColors = new List<Color>();
|
||||
public List<Color> TextColors = new List<Color>();
|
||||
|
||||
public But1(Par Par, Action<But> Action)
|
||||
: base(Par, Action)
|
||||
{
|
||||
Setting();
|
||||
}
|
||||
public But1(Par Par, Action<But> Action)
|
||||
: base(Par, Action)
|
||||
{
|
||||
Setting();
|
||||
}
|
||||
|
||||
public But1(ParT ParT, Action<But> Action)
|
||||
: base(ParT, Action)
|
||||
{
|
||||
Setting();
|
||||
}
|
||||
public But1(ParT ParT, Action<But> Action)
|
||||
: base(ParT, Action)
|
||||
{
|
||||
Setting();
|
||||
}
|
||||
|
||||
public But1(Pars Pars, Action<But> Action)
|
||||
: base(Pars, Action)
|
||||
{
|
||||
Setting();
|
||||
}
|
||||
public But1(Pars Pars, Action<But> Action)
|
||||
: base(Pars, Action)
|
||||
{
|
||||
Setting();
|
||||
}
|
||||
|
||||
private void Setting()
|
||||
{
|
||||
foreach (Par item in pars.EnumAllPar())
|
||||
{
|
||||
BaseColors.Add(item.BrushColor);
|
||||
OverColors.Add(BaseColors.Last().FuncHSV(delegate(Hsv hsv)
|
||||
{
|
||||
hsv.Hue += 30;
|
||||
hsv.Sat -= 30;
|
||||
hsv.Val += 100;
|
||||
return hsv;
|
||||
}));
|
||||
PushColors.Add(OverColors.Last().FuncHSV(delegate(Hsv hsv)
|
||||
{
|
||||
hsv.Hue += 30;
|
||||
hsv.Sat -= 30;
|
||||
hsv.Val += 100;
|
||||
return hsv;
|
||||
}));
|
||||
TextColors.Add(item.IsParT() ? item.ToParT().TextColor : Color.Empty);
|
||||
}
|
||||
Over = delegate
|
||||
{
|
||||
int num4 = 0;
|
||||
foreach (Par item2 in pars.EnumAllPar())
|
||||
{
|
||||
item2.BrushColor = OverColors[num4];
|
||||
if (item2.IsParT())
|
||||
{
|
||||
item2.ToParT().TextColor = TextColors[num4].Reverse();
|
||||
}
|
||||
num4++;
|
||||
}
|
||||
};
|
||||
Push = delegate
|
||||
{
|
||||
int num3 = 0;
|
||||
foreach (Par item3 in pars.EnumAllPar())
|
||||
{
|
||||
item3.BrushColor = PushColors[num3];
|
||||
if (item3.IsParT())
|
||||
{
|
||||
item3.ToParT().TextColor = TextColors[num3].Reverse();
|
||||
}
|
||||
num3++;
|
||||
}
|
||||
};
|
||||
Release = delegate
|
||||
{
|
||||
int num2 = 0;
|
||||
foreach (Par item4 in pars.EnumAllPar())
|
||||
{
|
||||
item4.BrushColor = OverColors[num2];
|
||||
if (item4.IsParT())
|
||||
{
|
||||
item4.ToParT().TextColor = TextColors[num2].Reverse();
|
||||
}
|
||||
num2++;
|
||||
}
|
||||
};
|
||||
Out = delegate
|
||||
{
|
||||
int num = 0;
|
||||
foreach (Par item5 in pars.EnumAllPar())
|
||||
{
|
||||
item5.BrushColor = BaseColors[num];
|
||||
if (item5.IsParT())
|
||||
{
|
||||
item5.ToParT().TextColor = TextColors[num];
|
||||
}
|
||||
num++;
|
||||
}
|
||||
};
|
||||
}
|
||||
private void Setting()
|
||||
{
|
||||
foreach (Par item in pars.EnumAllPar())
|
||||
{
|
||||
BaseColors.Add(item.BrushColor);
|
||||
OverColors.Add(BaseColors.Last().FuncHSV(delegate(Hsv hsv)
|
||||
{
|
||||
hsv.Hue += 30;
|
||||
hsv.Sat -= 30;
|
||||
hsv.Val += 100;
|
||||
return hsv;
|
||||
}));
|
||||
PushColors.Add(OverColors.Last().FuncHSV(delegate(Hsv hsv)
|
||||
{
|
||||
hsv.Hue += 30;
|
||||
hsv.Sat -= 30;
|
||||
hsv.Val += 100;
|
||||
return hsv;
|
||||
}));
|
||||
TextColors.Add(item.IsParT() ? item.ToParT().TextColor : Color.Empty);
|
||||
}
|
||||
Over = delegate
|
||||
{
|
||||
int num4 = 0;
|
||||
foreach (Par item2 in pars.EnumAllPar())
|
||||
{
|
||||
item2.BrushColor = OverColors[num4];
|
||||
if (item2.IsParT())
|
||||
{
|
||||
item2.ToParT().TextColor = TextColors[num4].Reverse();
|
||||
}
|
||||
num4++;
|
||||
}
|
||||
};
|
||||
Push = delegate
|
||||
{
|
||||
int num3 = 0;
|
||||
foreach (Par item3 in pars.EnumAllPar())
|
||||
{
|
||||
item3.BrushColor = PushColors[num3];
|
||||
if (item3.IsParT())
|
||||
{
|
||||
item3.ToParT().TextColor = TextColors[num3].Reverse();
|
||||
}
|
||||
num3++;
|
||||
}
|
||||
};
|
||||
Release = delegate
|
||||
{
|
||||
int num2 = 0;
|
||||
foreach (Par item4 in pars.EnumAllPar())
|
||||
{
|
||||
item4.BrushColor = OverColors[num2];
|
||||
if (item4.IsParT())
|
||||
{
|
||||
item4.ToParT().TextColor = TextColors[num2].Reverse();
|
||||
}
|
||||
num2++;
|
||||
}
|
||||
};
|
||||
Out = delegate
|
||||
{
|
||||
int num = 0;
|
||||
foreach (Par item5 in pars.EnumAllPar())
|
||||
{
|
||||
item5.BrushColor = BaseColors[num];
|
||||
if (item5.IsParT())
|
||||
{
|
||||
item5.ToParT().TextColor = TextColors[num];
|
||||
}
|
||||
num++;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,87 +2,88 @@ using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
public class Buts
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
private OrderedDictionary<string, But> buts = new OrderedDictionary<string, But>();
|
||||
public class Buts
|
||||
{
|
||||
private OrderedDictionary<string, But> buts = new OrderedDictionary<string, But>();
|
||||
|
||||
public But this[string Name] => buts[Name];
|
||||
public But this[string Name] => buts[Name];
|
||||
|
||||
public IEnumerable<But> EnumBut => buts.Values;
|
||||
public IEnumerable<But> EnumBut => buts.Values;
|
||||
|
||||
public void Add(string Name, But But)
|
||||
{
|
||||
buts.Add(Name, But);
|
||||
}
|
||||
public void Add(string Name, But But)
|
||||
{
|
||||
buts.Add(Name, But);
|
||||
}
|
||||
|
||||
public void Down(ref Color HitColor)
|
||||
{
|
||||
using IEnumerator<But> enumerator = buts.Values.GetEnumerator();
|
||||
while (enumerator.MoveNext() && !enumerator.Current.Down(ref HitColor))
|
||||
{
|
||||
}
|
||||
}
|
||||
public void Down(ref Color HitColor)
|
||||
{
|
||||
using IEnumerator<But> enumerator = buts.Values.GetEnumerator();
|
||||
while (enumerator.MoveNext() && !enumerator.Current.Down(ref HitColor))
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public void Up(ref Color HitColor)
|
||||
{
|
||||
using IEnumerator<But> enumerator = buts.Values.GetEnumerator();
|
||||
while (enumerator.MoveNext() && !enumerator.Current.Up(ref HitColor))
|
||||
{
|
||||
}
|
||||
}
|
||||
public void Up(ref Color HitColor)
|
||||
{
|
||||
using IEnumerator<But> enumerator = buts.Values.GetEnumerator();
|
||||
while (enumerator.MoveNext() && !enumerator.Current.Up(ref HitColor))
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public void Move(ref Color HitColor)
|
||||
{
|
||||
foreach (But value in buts.Values)
|
||||
{
|
||||
value.Move(ref HitColor);
|
||||
}
|
||||
}
|
||||
public void Move(ref Color HitColor)
|
||||
{
|
||||
foreach (But value in buts.Values)
|
||||
{
|
||||
value.Move(ref HitColor);
|
||||
}
|
||||
}
|
||||
|
||||
public void Leave()
|
||||
{
|
||||
using IEnumerator<But> enumerator = buts.Values.GetEnumerator();
|
||||
while (enumerator.MoveNext() && !enumerator.Current.Leave())
|
||||
{
|
||||
}
|
||||
}
|
||||
public void Leave()
|
||||
{
|
||||
using IEnumerator<But> enumerator = buts.Values.GetEnumerator();
|
||||
while (enumerator.MoveNext() && !enumerator.Current.Leave())
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public void SetHitColor(Med Med)
|
||||
{
|
||||
foreach (But item in EnumBut)
|
||||
{
|
||||
item.SetHitColor(Med);
|
||||
}
|
||||
}
|
||||
public void SetHitColor(Med Med)
|
||||
{
|
||||
foreach (But item in EnumBut)
|
||||
{
|
||||
item.SetHitColor(Med);
|
||||
}
|
||||
}
|
||||
|
||||
public void Draw(Are Are)
|
||||
{
|
||||
foreach (But value in buts.Values)
|
||||
{
|
||||
value.Draw(Are);
|
||||
}
|
||||
}
|
||||
public void Draw(Are Are)
|
||||
{
|
||||
foreach (But value in buts.Values)
|
||||
{
|
||||
value.Draw(Are);
|
||||
}
|
||||
}
|
||||
|
||||
public void Draw(AreM AreM)
|
||||
{
|
||||
foreach (But value in buts.Values)
|
||||
{
|
||||
value.Draw(AreM);
|
||||
}
|
||||
}
|
||||
public void Draw(AreM AreM)
|
||||
{
|
||||
foreach (But value in buts.Values)
|
||||
{
|
||||
value.Draw(AreM);
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
foreach (But value in buts.Values)
|
||||
{
|
||||
value.Dispose();
|
||||
}
|
||||
}
|
||||
public void Dispose()
|
||||
{
|
||||
foreach (But value in buts.Values)
|
||||
{
|
||||
value.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsHit(Color hc)
|
||||
{
|
||||
return EnumBut.Any((But e) => e.Pars.Values.First().ToPar().HitColor == hc);
|
||||
}
|
||||
public bool IsHit(Color hc)
|
||||
{
|
||||
return EnumBut.Any((But e) => e.Pars.Values.First().ToPar().HitColor == hc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
public class ConstProp
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
private int c = -1;
|
||||
public class ConstProp
|
||||
{
|
||||
private int c = -1;
|
||||
|
||||
public bool GetFlag(double Proportion)
|
||||
{
|
||||
c++;
|
||||
return c % (int)(1.0 / Proportion) == 0;
|
||||
}
|
||||
public bool GetFlag(double Proportion)
|
||||
{
|
||||
c++;
|
||||
return c % (int)(1.0 / Proportion) == 0;
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
c = -1;
|
||||
}
|
||||
public void Reset()
|
||||
{
|
||||
c = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Size = 1)]
|
||||
public struct Dat
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
public static MatrixD MatDZero = new MatrixD(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
|
||||
[StructLayout(LayoutKind.Sequential, Size = 1)]
|
||||
public struct Dat
|
||||
{
|
||||
public static MatrixD MatDZero = new MatrixD(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
|
||||
|
||||
public static MatrixD MatDIdentity = new MatrixD(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0);
|
||||
public static MatrixD MatDIdentity = new MatrixD(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0);
|
||||
|
||||
public static Vector2D Vec2DZero = new Vector2D(0.0, 0.0);
|
||||
public static Vector2D Vec2DZero = new Vector2D(0.0, 0.0);
|
||||
|
||||
public static Vector2D Vec2DOne = new Vector2D(1.0, 1.0);
|
||||
public static Vector2D Vec2DOne = new Vector2D(1.0, 1.0);
|
||||
|
||||
public static Vector2D Vec2DUnitX = new Vector2D(1.0, 0.0);
|
||||
public static Vector2D Vec2DUnitX = new Vector2D(1.0, 0.0);
|
||||
|
||||
public static Vector2D Vec2DUnitY = new Vector2D(0.0, 1.0);
|
||||
public static Vector2D Vec2DUnitY = new Vector2D(0.0, 1.0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,289 +2,290 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
[Serializable]
|
||||
public class Dif
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
public string Tag = "";
|
||||
[Serializable]
|
||||
public class Dif
|
||||
{
|
||||
public string Tag = "";
|
||||
|
||||
private List<Pars> parss = new List<Pars>();
|
||||
private List<Pars> parss = new List<Pars>();
|
||||
|
||||
public List<Pars> Parss => parss;
|
||||
public List<Pars> Parss => parss;
|
||||
|
||||
public int Count => parss.Count;
|
||||
public int Count => parss.Count;
|
||||
|
||||
public Pars this[int Index]
|
||||
{
|
||||
get
|
||||
{
|
||||
return parss[Index];
|
||||
}
|
||||
set
|
||||
{
|
||||
parss[Index] = value;
|
||||
}
|
||||
}
|
||||
public Pars this[int Index]
|
||||
{
|
||||
get
|
||||
{
|
||||
return parss[Index];
|
||||
}
|
||||
set
|
||||
{
|
||||
parss[Index] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public double PositionSize
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Pars item in parss)
|
||||
{
|
||||
item.PositionSize = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
public double PositionSize
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Pars item in parss)
|
||||
{
|
||||
item.PositionSize = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Vector2D PositionVector
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Pars item in parss)
|
||||
{
|
||||
item.PositionVector = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
public Vector2D PositionVector
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Pars item in parss)
|
||||
{
|
||||
item.PositionVector = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public double AngleBase
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Pars item in parss)
|
||||
{
|
||||
item.AngleBase = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
public double AngleBase
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Pars item in parss)
|
||||
{
|
||||
item.AngleBase = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public double AngleCont
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Pars item in parss)
|
||||
{
|
||||
item.AngleCont = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
public double AngleCont
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Pars item in parss)
|
||||
{
|
||||
item.AngleCont = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public double SizeBase
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Pars item in parss)
|
||||
{
|
||||
item.SizeBase = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
public double SizeBase
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Pars item in parss)
|
||||
{
|
||||
item.SizeBase = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public double SizeCont
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Pars item in parss)
|
||||
{
|
||||
item.SizeCont = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
public double SizeCont
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Pars item in parss)
|
||||
{
|
||||
item.SizeCont = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public double SizeXBase
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Pars item in parss)
|
||||
{
|
||||
item.SizeXBase = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
public double SizeXBase
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Pars item in parss)
|
||||
{
|
||||
item.SizeXBase = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public double SizeXCont
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Pars item in parss)
|
||||
{
|
||||
item.SizeXCont = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
public double SizeXCont
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Pars item in parss)
|
||||
{
|
||||
item.SizeXCont = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public double SizeYBase
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Pars item in parss)
|
||||
{
|
||||
item.SizeYBase = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
public double SizeYBase
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Pars item in parss)
|
||||
{
|
||||
item.SizeYBase = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public double SizeYCont
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Pars item in parss)
|
||||
{
|
||||
item.SizeYCont = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
public double SizeYCont
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Pars item in parss)
|
||||
{
|
||||
item.SizeYCont = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool Dra
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Pars item in parss)
|
||||
{
|
||||
item.Dra = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
public bool Dra
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Pars item in parss)
|
||||
{
|
||||
item.Dra = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool Hit
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Pars item in parss)
|
||||
{
|
||||
item.Hit = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
public bool Hit
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Pars item in parss)
|
||||
{
|
||||
item.Hit = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<Par> EnumAllPar()
|
||||
{
|
||||
foreach (Pars item in parss)
|
||||
{
|
||||
foreach (Par item2 in item.EnumAllPar())
|
||||
{
|
||||
yield return item2;
|
||||
}
|
||||
}
|
||||
}
|
||||
public IEnumerable<Par> EnumAllPar()
|
||||
{
|
||||
foreach (Pars item in parss)
|
||||
{
|
||||
foreach (Par item2 in item.EnumAllPar())
|
||||
{
|
||||
yield return item2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void SetDefault()
|
||||
{
|
||||
foreach (Pars item in parss)
|
||||
{
|
||||
item.SetDefault();
|
||||
}
|
||||
}
|
||||
public void SetDefault()
|
||||
{
|
||||
foreach (Pars item in parss)
|
||||
{
|
||||
item.SetDefault();
|
||||
}
|
||||
}
|
||||
|
||||
public Dif()
|
||||
{
|
||||
}
|
||||
public Dif()
|
||||
{
|
||||
}
|
||||
|
||||
public Dif(Dif Dif)
|
||||
{
|
||||
Copy(Dif);
|
||||
}
|
||||
public Dif(Dif Dif)
|
||||
{
|
||||
Copy(Dif);
|
||||
}
|
||||
|
||||
private void Copy(Dif Dif)
|
||||
{
|
||||
Tag = Dif.Tag;
|
||||
foreach (Pars item in Dif.parss)
|
||||
{
|
||||
parss.Add(new Pars(item));
|
||||
}
|
||||
}
|
||||
private void Copy(Dif Dif)
|
||||
{
|
||||
Tag = Dif.Tag;
|
||||
foreach (Pars item in Dif.parss)
|
||||
{
|
||||
parss.Add(new Pars(item));
|
||||
}
|
||||
}
|
||||
|
||||
public void Add(Pars Pars)
|
||||
{
|
||||
parss.Add(Pars);
|
||||
}
|
||||
public void Add(Pars Pars)
|
||||
{
|
||||
parss.Add(Pars);
|
||||
}
|
||||
|
||||
public void Insert(int Index, Pars Pars)
|
||||
{
|
||||
parss.Insert(Index, Pars);
|
||||
}
|
||||
public void Insert(int Index, Pars Pars)
|
||||
{
|
||||
parss.Insert(Index, Pars);
|
||||
}
|
||||
|
||||
public void Remove(Pars Pars)
|
||||
{
|
||||
parss.Remove(Pars);
|
||||
}
|
||||
public void Remove(Pars Pars)
|
||||
{
|
||||
parss.Remove(Pars);
|
||||
}
|
||||
|
||||
public void RemoveAt(int Index)
|
||||
{
|
||||
parss.RemoveAt(Index);
|
||||
}
|
||||
public void RemoveAt(int Index)
|
||||
{
|
||||
parss.RemoveAt(Index);
|
||||
}
|
||||
|
||||
public void Draws(Are Are)
|
||||
{
|
||||
foreach (Pars item in parss)
|
||||
{
|
||||
Are.Draw(item);
|
||||
}
|
||||
}
|
||||
public void Draws(Are Are)
|
||||
{
|
||||
foreach (Pars item in parss)
|
||||
{
|
||||
Are.Draw(item);
|
||||
}
|
||||
}
|
||||
|
||||
public void Draws(AreM AreM)
|
||||
{
|
||||
foreach (Pars item in parss)
|
||||
{
|
||||
AreM.Draw(item);
|
||||
}
|
||||
}
|
||||
public void Draws(AreM AreM)
|
||||
{
|
||||
foreach (Pars item in parss)
|
||||
{
|
||||
AreM.Draw(item);
|
||||
}
|
||||
}
|
||||
|
||||
public List<string> GetHitTags(ref Color HitColor)
|
||||
{
|
||||
List<string> list = new List<string>();
|
||||
foreach (Pars item in parss)
|
||||
{
|
||||
list.AddRange(item.GetHitTags(ref HitColor));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
public List<string> GetHitTags(ref Color HitColor)
|
||||
{
|
||||
List<string> list = new List<string>();
|
||||
foreach (Pars item in parss)
|
||||
{
|
||||
list.AddRange(item.GetHitTags(ref HitColor));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public List<Par> GetHitPars(ref Color HitColor)
|
||||
{
|
||||
List<Par> list = new List<Par>();
|
||||
foreach (Pars item in parss)
|
||||
{
|
||||
list.AddRange(item.GetHitPars(ref HitColor));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
public List<Par> GetHitPars(ref Color HitColor)
|
||||
{
|
||||
List<Par> list = new List<Par>();
|
||||
foreach (Pars item in parss)
|
||||
{
|
||||
list.AddRange(item.GetHitPars(ref HitColor));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public bool IsHit(ref Color HitColor)
|
||||
{
|
||||
foreach (Pars item in parss)
|
||||
{
|
||||
if (item.IsHit(ref HitColor))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public bool IsHit(ref Color HitColor)
|
||||
{
|
||||
foreach (Pars item in parss)
|
||||
{
|
||||
if (item.IsHit(ref HitColor))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void ReverseX()
|
||||
{
|
||||
foreach (Pars item in parss)
|
||||
{
|
||||
item.ReverseX();
|
||||
}
|
||||
}
|
||||
public void ReverseX()
|
||||
{
|
||||
foreach (Pars item in parss)
|
||||
{
|
||||
item.ReverseX();
|
||||
}
|
||||
}
|
||||
|
||||
public void ReverseY()
|
||||
{
|
||||
foreach (Pars item in parss)
|
||||
{
|
||||
item.ReverseY();
|
||||
}
|
||||
}
|
||||
public void ReverseY()
|
||||
{
|
||||
foreach (Pars item in parss)
|
||||
{
|
||||
item.ReverseY();
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
foreach (Pars item in parss)
|
||||
{
|
||||
item.Dispose();
|
||||
}
|
||||
}
|
||||
public void Dispose()
|
||||
{
|
||||
foreach (Pars item in parss)
|
||||
{
|
||||
item.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,471 +4,472 @@ using System.Drawing;
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
[Serializable]
|
||||
public class Difs
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
public string Tag = "";
|
||||
[Serializable]
|
||||
public class Difs
|
||||
{
|
||||
public string Tag = "";
|
||||
|
||||
public double ValueX;
|
||||
public double ValueX;
|
||||
|
||||
public double ValueY;
|
||||
public double ValueY;
|
||||
|
||||
private List<Dif> difs = new List<Dif>();
|
||||
private List<Dif> difs = new List<Dif>();
|
||||
|
||||
public Dictionary<Pars, Joints> pj;
|
||||
public Dictionary<Pars, Joints> pj;
|
||||
|
||||
public Dictionary<Pars, Par> pr;
|
||||
public Dictionary<Pars, Par> pr;
|
||||
|
||||
public List<Dif> Difss => difs;
|
||||
public List<Dif> Difss => difs;
|
||||
|
||||
public int CountX => difs.Count;
|
||||
public int CountX => difs.Count;
|
||||
|
||||
public int CountY
|
||||
{
|
||||
get
|
||||
{
|
||||
if (difs.Count > 0)
|
||||
{
|
||||
return difs[IndexX].Count;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
public int CountY
|
||||
{
|
||||
get
|
||||
{
|
||||
if (difs.Count > 0)
|
||||
{
|
||||
return difs[IndexX].Count;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public int IndexX
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!(ValueX >= 1.0))
|
||||
{
|
||||
return (int)((double)CountX * ValueX);
|
||||
}
|
||||
return CountX - 1;
|
||||
}
|
||||
set
|
||||
{
|
||||
ValueX = (double)value / (double)CountX;
|
||||
}
|
||||
}
|
||||
public int IndexX
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!(ValueX >= 1.0))
|
||||
{
|
||||
return (int)((double)CountX * ValueX);
|
||||
}
|
||||
return CountX - 1;
|
||||
}
|
||||
set
|
||||
{
|
||||
ValueX = (double)value / (double)CountX;
|
||||
}
|
||||
}
|
||||
|
||||
public int IndexY
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!(ValueY >= 1.0))
|
||||
{
|
||||
return (int)((double)CountY * ValueY);
|
||||
}
|
||||
return CountY - 1;
|
||||
}
|
||||
set
|
||||
{
|
||||
ValueY = (double)value / (double)CountY;
|
||||
}
|
||||
}
|
||||
public int IndexY
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!(ValueY >= 1.0))
|
||||
{
|
||||
return (int)((double)CountY * ValueY);
|
||||
}
|
||||
return CountY - 1;
|
||||
}
|
||||
set
|
||||
{
|
||||
ValueY = (double)value / (double)CountY;
|
||||
}
|
||||
}
|
||||
|
||||
public Dif this[int Index]
|
||||
{
|
||||
get
|
||||
{
|
||||
return difs[Index];
|
||||
}
|
||||
set
|
||||
{
|
||||
difs[Index] = value;
|
||||
}
|
||||
}
|
||||
public Dif this[int Index]
|
||||
{
|
||||
get
|
||||
{
|
||||
return difs[Index];
|
||||
}
|
||||
set
|
||||
{
|
||||
difs[Index] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public Pars Current => difs[IndexX][IndexY];
|
||||
public Pars Current => difs[IndexX][IndexY];
|
||||
|
||||
public double PositionSize
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
dif.PositionSize = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
public double PositionSize
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
dif.PositionSize = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Vector2D PositionVector
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
dif.PositionVector = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
public Vector2D PositionVector
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
dif.PositionVector = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public double AngleBase
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
dif.AngleBase = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
public double AngleBase
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
dif.AngleBase = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public double AngleCont
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
dif.AngleCont = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
public double AngleCont
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
dif.AngleCont = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public double SizeBase
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
dif.SizeBase = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
public double SizeBase
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
dif.SizeBase = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public double SizeCont
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
dif.SizeCont = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
public double SizeCont
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
dif.SizeCont = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public double SizeXBase
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
dif.SizeXBase = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
public double SizeXBase
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
dif.SizeXBase = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public double SizeXCont
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
dif.SizeXCont = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
public double SizeXCont
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
dif.SizeXCont = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public double SizeYBase
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
dif.SizeYBase = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
public double SizeYBase
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
dif.SizeYBase = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public double SizeYCont
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
dif.SizeYCont = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
public double SizeYCont
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
dif.SizeYCont = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool Dra
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
dif.Dra = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
public bool Dra
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
dif.Dra = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool Hit
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
dif.Hit = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
public bool Hit
|
||||
{
|
||||
set
|
||||
{
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
dif.Hit = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public Par CurJoinRoot
|
||||
{
|
||||
get
|
||||
{
|
||||
Pars current = Current;
|
||||
if (pr.ContainsKey(current))
|
||||
{
|
||||
return pr[current];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
[JsonIgnore]
|
||||
public Par CurJoinRoot
|
||||
{
|
||||
get
|
||||
{
|
||||
Pars current = Current;
|
||||
if (pr.ContainsKey(current))
|
||||
{
|
||||
return pr[current];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public IEnumerable<Par> EnumJoinRoot => pr.Values;
|
||||
public IEnumerable<Par> EnumAllPar()
|
||||
{
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
foreach (Par item in dif.EnumAllPar())
|
||||
{
|
||||
yield return item;
|
||||
}
|
||||
}
|
||||
}
|
||||
[JsonIgnore]
|
||||
public IEnumerable<Par> EnumJoinRoot => pr.Values;
|
||||
public IEnumerable<Par> EnumAllPar()
|
||||
{
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
foreach (Par item in dif.EnumAllPar())
|
||||
{
|
||||
yield return item;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<Pars> EnumAllPars()
|
||||
{
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
foreach (Pars item in dif.Parss)
|
||||
{
|
||||
yield return item;
|
||||
}
|
||||
}
|
||||
}
|
||||
public IEnumerable<Pars> EnumAllPars()
|
||||
{
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
foreach (Pars item in dif.Parss)
|
||||
{
|
||||
yield return item;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void SetDefault()
|
||||
{
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
dif.SetDefault();
|
||||
}
|
||||
}
|
||||
public void SetDefault()
|
||||
{
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
dif.SetDefault();
|
||||
}
|
||||
}
|
||||
|
||||
public Difs()
|
||||
{
|
||||
}
|
||||
public Difs()
|
||||
{
|
||||
}
|
||||
|
||||
public Difs(Difs Difs)
|
||||
{
|
||||
Copy(Difs);
|
||||
}
|
||||
public Difs(Difs Difs)
|
||||
{
|
||||
Copy(Difs);
|
||||
}
|
||||
|
||||
private void Copy(Difs Difs)
|
||||
{
|
||||
Tag = Difs.Tag;
|
||||
ValueX = Difs.ValueX;
|
||||
ValueY = Difs.ValueY;
|
||||
foreach (Dif dif in Difs.difs)
|
||||
{
|
||||
difs.Add(new Dif(dif));
|
||||
}
|
||||
}
|
||||
private void Copy(Difs Difs)
|
||||
{
|
||||
Tag = Difs.Tag;
|
||||
ValueX = Difs.ValueX;
|
||||
ValueY = Difs.ValueY;
|
||||
foreach (Dif dif in Difs.difs)
|
||||
{
|
||||
difs.Add(new Dif(dif));
|
||||
}
|
||||
}
|
||||
|
||||
public void Add(Dif Dif)
|
||||
{
|
||||
difs.Add(Dif);
|
||||
}
|
||||
public void Add(Dif Dif)
|
||||
{
|
||||
difs.Add(Dif);
|
||||
}
|
||||
|
||||
public void Insert(int Index, Dif Dif)
|
||||
{
|
||||
difs.Insert(Index, Dif);
|
||||
}
|
||||
public void Insert(int Index, Dif Dif)
|
||||
{
|
||||
difs.Insert(Index, Dif);
|
||||
}
|
||||
|
||||
public void Remove(Dif Dif)
|
||||
{
|
||||
difs.Remove(Dif);
|
||||
}
|
||||
public void Remove(Dif Dif)
|
||||
{
|
||||
difs.Remove(Dif);
|
||||
}
|
||||
|
||||
public void RemoveAt(int Index)
|
||||
{
|
||||
difs.RemoveAt(Index);
|
||||
}
|
||||
public void RemoveAt(int Index)
|
||||
{
|
||||
difs.RemoveAt(Index);
|
||||
}
|
||||
|
||||
public void Draw(Are Are)
|
||||
{
|
||||
Are.Draw(Current);
|
||||
}
|
||||
public void Draw(Are Are)
|
||||
{
|
||||
Are.Draw(Current);
|
||||
}
|
||||
|
||||
public void Draws(Are Are)
|
||||
{
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
dif.Draws(Are);
|
||||
}
|
||||
}
|
||||
public void Draws(Are Are)
|
||||
{
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
dif.Draws(Are);
|
||||
}
|
||||
}
|
||||
|
||||
public void Draw(AreM AreM)
|
||||
{
|
||||
AreM.Draw(Current);
|
||||
}
|
||||
public void Draw(AreM AreM)
|
||||
{
|
||||
AreM.Draw(Current);
|
||||
}
|
||||
|
||||
public void Draws(AreM AreM)
|
||||
{
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
dif.Draws(AreM);
|
||||
}
|
||||
}
|
||||
private Par GetJoinRoot(Pars ps)
|
||||
{
|
||||
Par[] array = ps.EnumAllPar().ToArray();
|
||||
if (array.Length <= 1)
|
||||
{
|
||||
return array.FirstOrDefault();
|
||||
}
|
||||
Par[] array2 = array;
|
||||
foreach (Par p0 in array2)
|
||||
{
|
||||
Vector2D p = p0.Position;
|
||||
if (array.All((Par p1) => p0 == p1 || p1.JP.All((Joi j) => !(p1.ToGlobal(j.Joint).DistanceSquared(p) <= Join.IdentityDistance))))
|
||||
{
|
||||
return p0;
|
||||
}
|
||||
}
|
||||
Par par = array.FirstOrDefault((Par e) => e.JP.Count > 0);
|
||||
if (par != null)
|
||||
{
|
||||
return par;
|
||||
}
|
||||
return array.First();
|
||||
}
|
||||
public void Draws(AreM AreM)
|
||||
{
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
dif.Draws(AreM);
|
||||
}
|
||||
}
|
||||
private Par GetJoinRoot(Pars ps)
|
||||
{
|
||||
Par[] array = ps.EnumAllPar().ToArray();
|
||||
if (array.Length <= 1)
|
||||
{
|
||||
return array.FirstOrDefault();
|
||||
}
|
||||
Par[] array2 = array;
|
||||
foreach (Par p0 in array2)
|
||||
{
|
||||
Vector2D p = p0.Position;
|
||||
if (array.All((Par p1) => p0 == p1 || p1.JP.All((Joi j) => !(p1.ToGlobal(j.Joint).DistanceSquared(p) <= Join.IdentityDistance))))
|
||||
{
|
||||
return p0;
|
||||
}
|
||||
}
|
||||
Par par = array.FirstOrDefault((Par e) => e.JP.Count > 0);
|
||||
if (par != null)
|
||||
{
|
||||
return par;
|
||||
}
|
||||
return array.First();
|
||||
}
|
||||
|
||||
public void SetJoints()
|
||||
{
|
||||
pj = new Dictionary<Pars, Joints>();
|
||||
pr = new Dictionary<Pars, Par>();
|
||||
foreach (Pars item in EnumAllPars())
|
||||
{
|
||||
Par joinRoot = GetJoinRoot(item);
|
||||
if (joinRoot != null)
|
||||
{
|
||||
pj.Add(item, joinRoot.GetJoints(item.EnumAllPar()));
|
||||
pr.Add(item, joinRoot);
|
||||
}
|
||||
}
|
||||
}
|
||||
public void SetJoints()
|
||||
{
|
||||
pj = new Dictionary<Pars, Joints>();
|
||||
pr = new Dictionary<Pars, Par>();
|
||||
foreach (Pars item in EnumAllPars())
|
||||
{
|
||||
Par joinRoot = GetJoinRoot(item);
|
||||
if (joinRoot != null)
|
||||
{
|
||||
pj.Add(item, joinRoot.GetJoints(item.EnumAllPar()));
|
||||
pr.Add(item, joinRoot);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void JoinP()
|
||||
{
|
||||
pj[Current].JoinP();
|
||||
}
|
||||
public void JoinP()
|
||||
{
|
||||
pj[Current].JoinP();
|
||||
}
|
||||
|
||||
public void JoinPA()
|
||||
{
|
||||
pj[Current].JoinPA();
|
||||
}
|
||||
public void JoinPA()
|
||||
{
|
||||
pj[Current].JoinPA();
|
||||
}
|
||||
|
||||
public void JoinPall()
|
||||
{
|
||||
foreach (Joints value in pj.Values)
|
||||
{
|
||||
value.JoinP();
|
||||
}
|
||||
}
|
||||
public void JoinPall()
|
||||
{
|
||||
foreach (Joints value in pj.Values)
|
||||
{
|
||||
value.JoinP();
|
||||
}
|
||||
}
|
||||
|
||||
public void JoinPAall()
|
||||
{
|
||||
foreach (Joints value in pj.Values)
|
||||
{
|
||||
value.JoinPA();
|
||||
}
|
||||
}
|
||||
public void JoinPAall()
|
||||
{
|
||||
foreach (Joints value in pj.Values)
|
||||
{
|
||||
value.JoinPA();
|
||||
}
|
||||
}
|
||||
|
||||
public void JoinP(Pars ps)
|
||||
{
|
||||
if (pj.ContainsKey(ps))
|
||||
{
|
||||
pj[ps].JoinP();
|
||||
}
|
||||
}
|
||||
public void JoinP(Pars ps)
|
||||
{
|
||||
if (pj.ContainsKey(ps))
|
||||
{
|
||||
pj[ps].JoinP();
|
||||
}
|
||||
}
|
||||
|
||||
public void JoinPA(Pars ps)
|
||||
{
|
||||
if (pj.ContainsKey(ps))
|
||||
{
|
||||
pj[ps].JoinPA();
|
||||
}
|
||||
}
|
||||
public void JoinPA(Pars ps)
|
||||
{
|
||||
if (pj.ContainsKey(ps))
|
||||
{
|
||||
pj[ps].JoinPA();
|
||||
}
|
||||
}
|
||||
|
||||
public Par GetHitPar_(Color HitColor)
|
||||
{
|
||||
return difs.FirstOrDefault((Dif d) => d.IsHit(ref HitColor)).Parss.FirstOrDefault((Pars ps) => ps.IsHit(ref HitColor)).EnumAllPar().FirstOrDefault((Par e) => e.HitColor == HitColor);
|
||||
}
|
||||
public Par GetHitPar_(Color HitColor)
|
||||
{
|
||||
return difs.FirstOrDefault((Dif d) => d.IsHit(ref HitColor)).Parss.FirstOrDefault((Pars ps) => ps.IsHit(ref HitColor)).EnumAllPar().FirstOrDefault((Par e) => e.HitColor == HitColor);
|
||||
}
|
||||
|
||||
public List<string> GetHitTags(ref Color HitColor)
|
||||
{
|
||||
List<string> list = new List<string>();
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
list.AddRange(dif.GetHitTags(ref HitColor));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
public List<string> GetHitTags(ref Color HitColor)
|
||||
{
|
||||
List<string> list = new List<string>();
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
list.AddRange(dif.GetHitTags(ref HitColor));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public List<Par> GetHitPars(ref Color HitColor)
|
||||
{
|
||||
List<Par> list = new List<Par>();
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
list.AddRange(dif.GetHitPars(ref HitColor));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
public List<Par> GetHitPars(ref Color HitColor)
|
||||
{
|
||||
List<Par> list = new List<Par>();
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
list.AddRange(dif.GetHitPars(ref HitColor));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public bool IsHit(ref Color HitColor)
|
||||
{
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
if (dif.IsHit(ref HitColor))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public bool IsHit(ref Color HitColor)
|
||||
{
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
if (dif.IsHit(ref HitColor))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void ReverseX()
|
||||
{
|
||||
SetJoints();
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
dif.ReverseX();
|
||||
}
|
||||
JoinP();
|
||||
}
|
||||
public void ReverseX()
|
||||
{
|
||||
SetJoints();
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
dif.ReverseX();
|
||||
}
|
||||
JoinP();
|
||||
}
|
||||
|
||||
public void ReverseY()
|
||||
{
|
||||
SetJoints();
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
dif.ReverseY();
|
||||
}
|
||||
JoinP();
|
||||
}
|
||||
public void ReverseY()
|
||||
{
|
||||
SetJoints();
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
dif.ReverseY();
|
||||
}
|
||||
JoinP();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
dif.Dispose();
|
||||
}
|
||||
}
|
||||
public void Dispose()
|
||||
{
|
||||
foreach (Dif dif in difs)
|
||||
{
|
||||
dif.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,38 +1,39 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
public class FPS
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
public Stopwatch sw = new Stopwatch();
|
||||
public class FPS
|
||||
{
|
||||
public Stopwatch sw = new Stopwatch();
|
||||
|
||||
private long last_frame;
|
||||
public double Value;
|
||||
private long last_frame;
|
||||
public double Value;
|
||||
|
||||
private int count;
|
||||
private int count;
|
||||
|
||||
private double ticks_per_frame;
|
||||
public FPS(double FPS)
|
||||
{
|
||||
Value = FPS;
|
||||
ticks_per_frame = (double)Stopwatch.Frequency / FPS;
|
||||
sw.Start();
|
||||
last_frame = sw.ElapsedTicks;
|
||||
}
|
||||
private double ticks_per_frame;
|
||||
public FPS(double FPS)
|
||||
{
|
||||
Value = FPS;
|
||||
ticks_per_frame = (double)Stopwatch.Frequency / FPS;
|
||||
sw.Start();
|
||||
last_frame = sw.ElapsedTicks;
|
||||
}
|
||||
|
||||
public void FPSFixed(Action Action)
|
||||
{
|
||||
long current_time = sw.ElapsedTicks;
|
||||
public void FPSFixed(Action Action)
|
||||
{
|
||||
long current_time = sw.ElapsedTicks;
|
||||
|
||||
if (current_time - last_frame >= ticks_per_frame)
|
||||
{
|
||||
Action();
|
||||
if (current_time - last_frame >= ticks_per_frame)
|
||||
{
|
||||
Action();
|
||||
|
||||
Value = (9 * Value + ((double)Stopwatch.Frequency / (sw.ElapsedTicks - last_frame)))/10;
|
||||
Value = (9 * Value + ((double)Stopwatch.Frequency / (sw.ElapsedTicks - last_frame)))/10;
|
||||
|
||||
last_frame = current_time;
|
||||
}
|
||||
last_frame = current_time;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,306 +1,307 @@
|
||||
using System.Drawing;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
public static class HSV
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
public static void ToHSV(int r, int g, int b, out int h, out int s, out int v)
|
||||
{
|
||||
v = GetMax(r, g, b);
|
||||
int num = v - GetMin(r, g, b);
|
||||
if (num == 0)
|
||||
{
|
||||
s = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
s = (int)((double)(num * 255) / (double)v);
|
||||
}
|
||||
if (s == 0)
|
||||
{
|
||||
h = 0;
|
||||
return;
|
||||
}
|
||||
double num2 = num;
|
||||
if (r == v)
|
||||
{
|
||||
h = v - (int)((double)(b * 60) / num2) - (v - (int)((double)(g * 60) / num2));
|
||||
}
|
||||
else if (g == v)
|
||||
{
|
||||
h = 120 + (v - (int)((double)(r * 60) / num2)) - (v - (int)((double)(b * 60) / num2));
|
||||
}
|
||||
else
|
||||
{
|
||||
h = 240 + (v - (int)((double)(g * 60) / num2)) - (v - (int)((double)(r * 60) / num2));
|
||||
}
|
||||
if (h < 0)
|
||||
{
|
||||
h += 360;
|
||||
}
|
||||
}
|
||||
public static class HSV
|
||||
{
|
||||
public static void ToHSV(int r, int g, int b, out int h, out int s, out int v)
|
||||
{
|
||||
v = GetMax(r, g, b);
|
||||
int num = v - GetMin(r, g, b);
|
||||
if (num == 0)
|
||||
{
|
||||
s = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
s = (int)((double)(num * 255) / (double)v);
|
||||
}
|
||||
if (s == 0)
|
||||
{
|
||||
h = 0;
|
||||
return;
|
||||
}
|
||||
double num2 = num;
|
||||
if (r == v)
|
||||
{
|
||||
h = v - (int)((double)(b * 60) / num2) - (v - (int)((double)(g * 60) / num2));
|
||||
}
|
||||
else if (g == v)
|
||||
{
|
||||
h = 120 + (v - (int)((double)(r * 60) / num2)) - (v - (int)((double)(b * 60) / num2));
|
||||
}
|
||||
else
|
||||
{
|
||||
h = 240 + (v - (int)((double)(g * 60) / num2)) - (v - (int)((double)(r * 60) / num2));
|
||||
}
|
||||
if (h < 0)
|
||||
{
|
||||
h += 360;
|
||||
}
|
||||
}
|
||||
|
||||
public static void ToRGB(int h, int s, int v, out int r, out int g, out int b)
|
||||
{
|
||||
if (s == 0)
|
||||
{
|
||||
r = (g = (b = v));
|
||||
return;
|
||||
}
|
||||
int num = h * 6;
|
||||
switch (num / 360)
|
||||
{
|
||||
case 0:
|
||||
r = v;
|
||||
g = (int)((double)(v * (255 - (int)((double)(s * (360 - num % 360)) / 360.0))) / 255.0);
|
||||
b = (int)((double)(v * (255 - s)) / 255.0);
|
||||
break;
|
||||
case 1:
|
||||
r = (int)((double)(v * (255 - (int)((double)(s * (num % 360)) / 360.0))) / 255.0);
|
||||
g = v;
|
||||
b = (int)((double)(v * (255 - s)) / 255.0);
|
||||
break;
|
||||
case 2:
|
||||
r = (int)((double)(v * (255 - s)) / 255.0);
|
||||
g = v;
|
||||
b = (int)((double)(v * (255 - (int)((double)(s * (360 - num % 360)) / 360.0))) / 255.0);
|
||||
break;
|
||||
case 3:
|
||||
r = (int)((double)(v * (255 - s)) / 255.0);
|
||||
g = (int)((double)(v * (255 - (int)((double)(s * (num % 360)) / 360.0))) / 255.0);
|
||||
b = v;
|
||||
break;
|
||||
case 4:
|
||||
r = (int)((double)(v * (255 - (int)((double)(s * (360 - num % 360)) / 360.0))) / 255.0);
|
||||
g = (int)((double)(v * (255 - s)) / 255.0);
|
||||
b = v;
|
||||
break;
|
||||
default:
|
||||
r = v;
|
||||
g = (int)((double)(v * (255 - s)) / 255.0);
|
||||
b = (int)((double)(v * (255 - (int)((double)(s * (num % 360)) / 360.0))) / 255.0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
public static void ToRGB(int h, int s, int v, out int r, out int g, out int b)
|
||||
{
|
||||
if (s == 0)
|
||||
{
|
||||
r = (g = (b = v));
|
||||
return;
|
||||
}
|
||||
int num = h * 6;
|
||||
switch (num / 360)
|
||||
{
|
||||
case 0:
|
||||
r = v;
|
||||
g = (int)((double)(v * (255 - (int)((double)(s * (360 - num % 360)) / 360.0))) / 255.0);
|
||||
b = (int)((double)(v * (255 - s)) / 255.0);
|
||||
break;
|
||||
case 1:
|
||||
r = (int)((double)(v * (255 - (int)((double)(s * (num % 360)) / 360.0))) / 255.0);
|
||||
g = v;
|
||||
b = (int)((double)(v * (255 - s)) / 255.0);
|
||||
break;
|
||||
case 2:
|
||||
r = (int)((double)(v * (255 - s)) / 255.0);
|
||||
g = v;
|
||||
b = (int)((double)(v * (255 - (int)((double)(s * (360 - num % 360)) / 360.0))) / 255.0);
|
||||
break;
|
||||
case 3:
|
||||
r = (int)((double)(v * (255 - s)) / 255.0);
|
||||
g = (int)((double)(v * (255 - (int)((double)(s * (num % 360)) / 360.0))) / 255.0);
|
||||
b = v;
|
||||
break;
|
||||
case 4:
|
||||
r = (int)((double)(v * (255 - (int)((double)(s * (360 - num % 360)) / 360.0))) / 255.0);
|
||||
g = (int)((double)(v * (255 - s)) / 255.0);
|
||||
b = v;
|
||||
break;
|
||||
default:
|
||||
r = v;
|
||||
g = (int)((double)(v * (255 - s)) / 255.0);
|
||||
b = (int)((double)(v * (255 - (int)((double)(s * (num % 360)) / 360.0))) / 255.0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public static void ToHSV(this Color col, out int h, out int s, out int v)
|
||||
{
|
||||
ToHSV(col.R, col.G, col.B, out h, out s, out v);
|
||||
}
|
||||
public static void ToHSV(this Color col, out int h, out int s, out int v)
|
||||
{
|
||||
ToHSV(col.R, col.G, col.B, out h, out s, out v);
|
||||
}
|
||||
|
||||
public static void ToHSV(ref Color col, out int h, out int s, out int v)
|
||||
{
|
||||
ToHSV(col.R, col.G, col.B, out h, out s, out v);
|
||||
}
|
||||
public static void ToHSV(ref Color col, out int h, out int s, out int v)
|
||||
{
|
||||
ToHSV(col.R, col.G, col.B, out h, out s, out v);
|
||||
}
|
||||
|
||||
public static void ToRGB(int h, int s, int v, out Color ret)
|
||||
{
|
||||
ToRGB(h, s, v, out var r, out var g, out var b);
|
||||
ret = Color.FromArgb(r, g, b);
|
||||
}
|
||||
public static void ToRGB(int h, int s, int v, out Color ret)
|
||||
{
|
||||
ToRGB(h, s, v, out var r, out var g, out var b);
|
||||
ret = Color.FromArgb(r, g, b);
|
||||
}
|
||||
|
||||
public static void ToRGB(int h, int s, int v, int a, out Color ret)
|
||||
{
|
||||
ToRGB(h, s, v, out var r, out var g, out var b);
|
||||
ret = Color.FromArgb(a, r, g, b);
|
||||
}
|
||||
public static void ToRGB(int h, int s, int v, int a, out Color ret)
|
||||
{
|
||||
ToRGB(h, s, v, out var r, out var g, out var b);
|
||||
ret = Color.FromArgb(a, r, g, b);
|
||||
}
|
||||
|
||||
public static void ToRGB(this Hsv hsv, out int r, out int g, out int b)
|
||||
{
|
||||
ToRGB(hsv.H, hsv.S, hsv.V, out r, out g, out b);
|
||||
}
|
||||
public static void ToRGB(this Hsv hsv, out int r, out int g, out int b)
|
||||
{
|
||||
ToRGB(hsv.H, hsv.S, hsv.V, out r, out g, out b);
|
||||
}
|
||||
|
||||
public static void ToRGB(ref Hsv hsv, out int r, out int g, out int b)
|
||||
{
|
||||
ToRGB(hsv.H, hsv.S, hsv.V, out r, out g, out b);
|
||||
}
|
||||
public static void ToRGB(ref Hsv hsv, out int r, out int g, out int b)
|
||||
{
|
||||
ToRGB(hsv.H, hsv.S, hsv.V, out r, out g, out b);
|
||||
}
|
||||
|
||||
public static Hsv ToHSV(int r, int g, int b)
|
||||
{
|
||||
Hsv result = default(Hsv);
|
||||
ToHSV(r, g, b, out result.H, out result.S, out result.V);
|
||||
return result;
|
||||
}
|
||||
public static Hsv ToHSV(int r, int g, int b)
|
||||
{
|
||||
Hsv result = default(Hsv);
|
||||
ToHSV(r, g, b, out result.H, out result.S, out result.V);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Hsv ToHSV(this Color col)
|
||||
{
|
||||
Hsv result = default(Hsv);
|
||||
ToHSV(col.R, col.G, col.B, out result.H, out result.S, out result.V);
|
||||
return result;
|
||||
}
|
||||
public static Hsv ToHSV(this Color col)
|
||||
{
|
||||
Hsv result = default(Hsv);
|
||||
ToHSV(col.R, col.G, col.B, out result.H, out result.S, out result.V);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Hsv ToHSV(ref Color col)
|
||||
{
|
||||
Hsv result = default(Hsv);
|
||||
ToHSV(col.R, col.G, col.B, out result.H, out result.S, out result.V);
|
||||
return result;
|
||||
}
|
||||
public static Hsv ToHSV(ref Color col)
|
||||
{
|
||||
Hsv result = default(Hsv);
|
||||
ToHSV(col.R, col.G, col.B, out result.H, out result.S, out result.V);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Color ToRGB(this Hsv hsv)
|
||||
{
|
||||
ToRGB(hsv.H, hsv.S, hsv.V, out var r, out var g, out var b);
|
||||
return Color.FromArgb(r, g, b);
|
||||
}
|
||||
public static Color ToRGB(this Hsv hsv)
|
||||
{
|
||||
ToRGB(hsv.H, hsv.S, hsv.V, out var r, out var g, out var b);
|
||||
return Color.FromArgb(r, g, b);
|
||||
}
|
||||
|
||||
public static Color ToRGB(ref Hsv hsv)
|
||||
{
|
||||
ToRGB(hsv.H, hsv.S, hsv.V, out var r, out var g, out var b);
|
||||
return Color.FromArgb(r, g, b);
|
||||
}
|
||||
public static Color ToRGB(ref Hsv hsv)
|
||||
{
|
||||
ToRGB(hsv.H, hsv.S, hsv.V, out var r, out var g, out var b);
|
||||
return Color.FromArgb(r, g, b);
|
||||
}
|
||||
|
||||
private static int GetMax(int x, int y, int z)
|
||||
{
|
||||
if (x < y)
|
||||
{
|
||||
if (z >= y)
|
||||
{
|
||||
return z;
|
||||
}
|
||||
return y;
|
||||
}
|
||||
if (z < x)
|
||||
{
|
||||
return x;
|
||||
}
|
||||
return z;
|
||||
}
|
||||
private static int GetMax(int x, int y, int z)
|
||||
{
|
||||
if (x < y)
|
||||
{
|
||||
if (z >= y)
|
||||
{
|
||||
return z;
|
||||
}
|
||||
return y;
|
||||
}
|
||||
if (z < x)
|
||||
{
|
||||
return x;
|
||||
}
|
||||
return z;
|
||||
}
|
||||
|
||||
private static int GetMin(int x, int y, int z)
|
||||
{
|
||||
if (x > y)
|
||||
{
|
||||
if (z <= y)
|
||||
{
|
||||
return z;
|
||||
}
|
||||
return y;
|
||||
}
|
||||
if (z > x)
|
||||
{
|
||||
return x;
|
||||
}
|
||||
return z;
|
||||
}
|
||||
}
|
||||
public struct Hsv
|
||||
{
|
||||
public int H;
|
||||
|
||||
public int S;
|
||||
|
||||
public int V;
|
||||
|
||||
public int Hue
|
||||
{
|
||||
get
|
||||
{
|
||||
return H;
|
||||
}
|
||||
set
|
||||
{
|
||||
H = value;
|
||||
HueLimit();
|
||||
}
|
||||
}
|
||||
|
||||
public int Sat
|
||||
{
|
||||
get
|
||||
{
|
||||
return S;
|
||||
}
|
||||
set
|
||||
{
|
||||
S = value;
|
||||
SatLimit();
|
||||
}
|
||||
}
|
||||
|
||||
public int Val
|
||||
{
|
||||
get
|
||||
{
|
||||
return V;
|
||||
}
|
||||
set
|
||||
{
|
||||
V = value;
|
||||
ValLimit();
|
||||
}
|
||||
}
|
||||
|
||||
public Hsv(Color Color)
|
||||
{
|
||||
HSV.ToHSV(Color.R, Color.G, Color.B, out H, out S, out V);
|
||||
}
|
||||
|
||||
public Hsv(ref Color Color)
|
||||
{
|
||||
HSV.ToHSV(Color.R, Color.G, Color.B, out H, out S, out V);
|
||||
}
|
||||
|
||||
public Hsv(int Hue, int Sat, int Val)
|
||||
{
|
||||
H = Hue;
|
||||
S = Sat;
|
||||
V = Val;
|
||||
}
|
||||
|
||||
private void HueLimit()
|
||||
{
|
||||
H %= 360;
|
||||
}
|
||||
|
||||
private void SatLimit()
|
||||
{
|
||||
if (S > 255)
|
||||
{
|
||||
S = 255;
|
||||
}
|
||||
else if (S < 0)
|
||||
{
|
||||
S = 0;
|
||||
}
|
||||
}
|
||||
|
||||
private void ValLimit()
|
||||
{
|
||||
if (V > 255)
|
||||
{
|
||||
V = 255;
|
||||
}
|
||||
else if (V < 0)
|
||||
{
|
||||
V = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public Color GetColor()
|
||||
{
|
||||
HSV.ToRGB(H, S, V, out var r, out var g, out var b);
|
||||
return Color.FromArgb(r, g, b);
|
||||
}
|
||||
|
||||
public Color GetColor(int a)
|
||||
{
|
||||
HSV.ToRGB(H, S, V, out var r, out var g, out var b);
|
||||
return Color.FromArgb(a, r, g, b);
|
||||
}
|
||||
|
||||
public void GetColor(out Color ret)
|
||||
{
|
||||
HSV.ToRGB(H, S, V, out var r, out var g, out var b);
|
||||
ret = Color.FromArgb(r, g, b);
|
||||
}
|
||||
|
||||
public void GetColor(int a, out Color ret)
|
||||
{
|
||||
HSV.ToRGB(H, S, V, out var r, out var g, out var b);
|
||||
ret = Color.FromArgb(a, r, g, b);
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return "H : " + H + " S : " + S + " V : " + V;
|
||||
}
|
||||
private static int GetMin(int x, int y, int z)
|
||||
{
|
||||
if (x > y)
|
||||
{
|
||||
if (z <= y)
|
||||
{
|
||||
return z;
|
||||
}
|
||||
return y;
|
||||
}
|
||||
if (z > x)
|
||||
{
|
||||
return x;
|
||||
}
|
||||
return z;
|
||||
}
|
||||
}
|
||||
public struct Hsv
|
||||
{
|
||||
public int H;
|
||||
|
||||
public int S;
|
||||
|
||||
public int V;
|
||||
|
||||
public int Hue
|
||||
{
|
||||
get
|
||||
{
|
||||
return H;
|
||||
}
|
||||
set
|
||||
{
|
||||
H = value;
|
||||
HueLimit();
|
||||
}
|
||||
}
|
||||
|
||||
public int Sat
|
||||
{
|
||||
get
|
||||
{
|
||||
return S;
|
||||
}
|
||||
set
|
||||
{
|
||||
S = value;
|
||||
SatLimit();
|
||||
}
|
||||
}
|
||||
|
||||
public int Val
|
||||
{
|
||||
get
|
||||
{
|
||||
return V;
|
||||
}
|
||||
set
|
||||
{
|
||||
V = value;
|
||||
ValLimit();
|
||||
}
|
||||
}
|
||||
|
||||
public Hsv(Color Color)
|
||||
{
|
||||
HSV.ToHSV(Color.R, Color.G, Color.B, out H, out S, out V);
|
||||
}
|
||||
|
||||
public Hsv(ref Color Color)
|
||||
{
|
||||
HSV.ToHSV(Color.R, Color.G, Color.B, out H, out S, out V);
|
||||
}
|
||||
|
||||
public Hsv(int Hue, int Sat, int Val)
|
||||
{
|
||||
H = Hue;
|
||||
S = Sat;
|
||||
V = Val;
|
||||
}
|
||||
|
||||
private void HueLimit()
|
||||
{
|
||||
H %= 360;
|
||||
}
|
||||
|
||||
private void SatLimit()
|
||||
{
|
||||
if (S > 255)
|
||||
{
|
||||
S = 255;
|
||||
}
|
||||
else if (S < 0)
|
||||
{
|
||||
S = 0;
|
||||
}
|
||||
}
|
||||
|
||||
private void ValLimit()
|
||||
{
|
||||
if (V > 255)
|
||||
{
|
||||
V = 255;
|
||||
}
|
||||
else if (V < 0)
|
||||
{
|
||||
V = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public Color GetColor()
|
||||
{
|
||||
HSV.ToRGB(H, S, V, out var r, out var g, out var b);
|
||||
return Color.FromArgb(r, g, b);
|
||||
}
|
||||
|
||||
public Color GetColor(int a)
|
||||
{
|
||||
HSV.ToRGB(H, S, V, out var r, out var g, out var b);
|
||||
return Color.FromArgb(a, r, g, b);
|
||||
}
|
||||
|
||||
public void GetColor(out Color ret)
|
||||
{
|
||||
HSV.ToRGB(H, S, V, out var r, out var g, out var b);
|
||||
ret = Color.FromArgb(r, g, b);
|
||||
}
|
||||
|
||||
public void GetColor(int a, out Color ret)
|
||||
{
|
||||
HSV.ToRGB(H, S, V, out var r, out var g, out var b);
|
||||
ret = Color.FromArgb(a, r, g, b);
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return "H : " + H + " S : " + S + " V : " + V;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,31 +1,32 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
|
||||
//its the position of a joint
|
||||
[Serializable]
|
||||
public class Joi
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
public Vector2D Joint = Dat.Vec2DZero;
|
||||
|
||||
public Joi()
|
||||
{
|
||||
}
|
||||
//its the position of a joint
|
||||
[Serializable]
|
||||
public class Joi
|
||||
{
|
||||
public Vector2D Joint = Dat.Vec2DZero;
|
||||
|
||||
public Joi(Joi Joi)
|
||||
{
|
||||
Joint = Joi.Joint;
|
||||
}
|
||||
public Joi()
|
||||
{
|
||||
}
|
||||
|
||||
public Joi(Vector2D Joint)
|
||||
{
|
||||
this.Joint = Joint;
|
||||
}
|
||||
public Joi(Joi Joi)
|
||||
{
|
||||
Joint = Joi.Joint;
|
||||
}
|
||||
|
||||
public Joi(ref Vector2D Joint)
|
||||
{
|
||||
this.Joint = Joint;
|
||||
}
|
||||
public Joi(Vector2D Joint)
|
||||
{
|
||||
this.Joint = Joint;
|
||||
}
|
||||
|
||||
public Joi(ref Vector2D Joint)
|
||||
{
|
||||
this.Joint = Joint;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,195 +2,196 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
public static class Join
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
public static double IdentityDistance = System.Math.Pow(5E-05, 2.0);
|
||||
public static class Join
|
||||
{
|
||||
public static double IdentityDistance = System.Math.Pow(5E-05, 2.0);
|
||||
|
||||
public static Joints GetJoints(this Par JoinRoot, IEnumerable<Par> EnumPar)
|
||||
{
|
||||
Joints joints = new Joints();
|
||||
int num = 0;
|
||||
List<int> list = new List<int>();
|
||||
List<Par> list2 = EnumPar.ToList();
|
||||
foreach (Joi item in JoinRoot.JP)
|
||||
{
|
||||
Vector2D v = JoinRoot.ToGlobal(item.Joint);
|
||||
int num2 = 0;
|
||||
list.Clear();
|
||||
foreach (Par item2 in list2)
|
||||
{
|
||||
if (JoinRoot != item2)
|
||||
{
|
||||
if (v.DistanceSquared(item2.Position) <= IdentityDistance)
|
||||
{
|
||||
joints.Joins.Add(new Joint(JoinRoot, num, item2));
|
||||
if (!list.Contains(num2))
|
||||
{
|
||||
list.Add(num2);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!list.Contains(num2))
|
||||
{
|
||||
list.Add(num2);
|
||||
}
|
||||
num2++;
|
||||
}
|
||||
for (int num3 = list.Count - 1; num3 > -1; num3--)
|
||||
{
|
||||
list2.RemoveAt(list[num3]);
|
||||
}
|
||||
num++;
|
||||
}
|
||||
GetJoints(list2, joints, list);
|
||||
return joints;
|
||||
}
|
||||
public static Joints GetJoints(this Par JoinRoot, IEnumerable<Par> EnumPar)
|
||||
{
|
||||
Joints joints = new Joints();
|
||||
int num = 0;
|
||||
List<int> list = new List<int>();
|
||||
List<Par> list2 = EnumPar.ToList();
|
||||
foreach (Joi item in JoinRoot.JP)
|
||||
{
|
||||
Vector2D v = JoinRoot.ToGlobal(item.Joint);
|
||||
int num2 = 0;
|
||||
list.Clear();
|
||||
foreach (Par item2 in list2)
|
||||
{
|
||||
if (JoinRoot != item2)
|
||||
{
|
||||
if (v.DistanceSquared(item2.Position) <= IdentityDistance)
|
||||
{
|
||||
joints.Joins.Add(new Joint(JoinRoot, num, item2));
|
||||
if (!list.Contains(num2))
|
||||
{
|
||||
list.Add(num2);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!list.Contains(num2))
|
||||
{
|
||||
list.Add(num2);
|
||||
}
|
||||
num2++;
|
||||
}
|
||||
for (int num3 = list.Count - 1; num3 > -1; num3--)
|
||||
{
|
||||
list2.RemoveAt(list[num3]);
|
||||
}
|
||||
num++;
|
||||
}
|
||||
GetJoints(list2, joints, list);
|
||||
return joints;
|
||||
}
|
||||
|
||||
private static void GetJoints(List<Par> pl, Joints js, List<int> del)
|
||||
{
|
||||
int num = -1;
|
||||
int num2 = 0;
|
||||
while (num != js.Joins.Count)
|
||||
{
|
||||
num = js.Joins.Count;
|
||||
for (int i = num2; i < num; i++)
|
||||
{
|
||||
Par par = js.Joins[i].Par1;
|
||||
int num3 = 0;
|
||||
foreach (Joi item in par.JP)
|
||||
{
|
||||
Vector2D v = par.ToGlobal(item.Joint);
|
||||
int num4 = 0;
|
||||
del.Clear();
|
||||
foreach (Par item2 in pl)
|
||||
{
|
||||
if (par != item2)
|
||||
{
|
||||
if (v.DistanceSquared(item2.Position) <= IdentityDistance)
|
||||
{
|
||||
js.Joins.Add(new Joint(par, num3, item2));
|
||||
if (!del.Contains(num4))
|
||||
{
|
||||
del.Add(num4);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!del.Contains(num4))
|
||||
{
|
||||
del.Add(num4);
|
||||
}
|
||||
num4++;
|
||||
}
|
||||
for (int num5 = del.Count - 1; num5 > -1; num5--)
|
||||
{
|
||||
pl.RemoveAt(del[num5]);
|
||||
}
|
||||
num3++;
|
||||
}
|
||||
}
|
||||
num2 = num;
|
||||
}
|
||||
}
|
||||
private static void GetJoints(List<Par> pl, Joints js, List<int> del)
|
||||
{
|
||||
int num = -1;
|
||||
int num2 = 0;
|
||||
while (num != js.Joins.Count)
|
||||
{
|
||||
num = js.Joins.Count;
|
||||
for (int i = num2; i < num; i++)
|
||||
{
|
||||
Par par = js.Joins[i].Par1;
|
||||
int num3 = 0;
|
||||
foreach (Joi item in par.JP)
|
||||
{
|
||||
Vector2D v = par.ToGlobal(item.Joint);
|
||||
int num4 = 0;
|
||||
del.Clear();
|
||||
foreach (Par item2 in pl)
|
||||
{
|
||||
if (par != item2)
|
||||
{
|
||||
if (v.DistanceSquared(item2.Position) <= IdentityDistance)
|
||||
{
|
||||
js.Joins.Add(new Joint(par, num3, item2));
|
||||
if (!del.Contains(num4))
|
||||
{
|
||||
del.Add(num4);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!del.Contains(num4))
|
||||
{
|
||||
del.Add(num4);
|
||||
}
|
||||
num4++;
|
||||
}
|
||||
for (int num5 = del.Count - 1; num5 > -1; num5--)
|
||||
{
|
||||
pl.RemoveAt(del[num5]);
|
||||
}
|
||||
num3++;
|
||||
}
|
||||
}
|
||||
num2 = num;
|
||||
}
|
||||
}
|
||||
|
||||
public static JointsD GetJointsD(this Difs JoinRoot, IEnumerable<Difs> EnumDifs)
|
||||
{
|
||||
JointsD jointsD = new JointsD();
|
||||
List<int> list = new List<int>();
|
||||
List<Difs> list2 = EnumDifs.ToList();
|
||||
foreach (Par item in JoinRoot.EnumAllPar())
|
||||
{
|
||||
int num = 0;
|
||||
list.Clear();
|
||||
foreach (Difs item2 in list2)
|
||||
{
|
||||
if (JoinRoot != item2)
|
||||
{
|
||||
int num2 = 0;
|
||||
foreach (Joi item3 in item.JP)
|
||||
{
|
||||
Vector2D v = item.ToGlobal(item3.Joint);
|
||||
foreach (Par item4 in item2.EnumJoinRoot)
|
||||
{
|
||||
if (v.DistanceSquared(item4.Position) <= IdentityDistance)
|
||||
{
|
||||
jointsD.Joins.Add(new JointD(JoinRoot, item, num2, item2));
|
||||
if (!list.Contains(num))
|
||||
{
|
||||
list.Add(num);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
num2++;
|
||||
}
|
||||
}
|
||||
else if (!list.Contains(num))
|
||||
{
|
||||
list.Add(num);
|
||||
}
|
||||
num++;
|
||||
}
|
||||
for (int num3 = list.Count - 1; num3 > -1; num3--)
|
||||
{
|
||||
list2.RemoveAt(list[num3]);
|
||||
}
|
||||
}
|
||||
GetJointsD(list2, jointsD, list);
|
||||
return jointsD;
|
||||
}
|
||||
public static JointsD GetJointsD(this Difs JoinRoot, IEnumerable<Difs> EnumDifs)
|
||||
{
|
||||
JointsD jointsD = new JointsD();
|
||||
List<int> list = new List<int>();
|
||||
List<Difs> list2 = EnumDifs.ToList();
|
||||
foreach (Par item in JoinRoot.EnumAllPar())
|
||||
{
|
||||
int num = 0;
|
||||
list.Clear();
|
||||
foreach (Difs item2 in list2)
|
||||
{
|
||||
if (JoinRoot != item2)
|
||||
{
|
||||
int num2 = 0;
|
||||
foreach (Joi item3 in item.JP)
|
||||
{
|
||||
Vector2D v = item.ToGlobal(item3.Joint);
|
||||
foreach (Par item4 in item2.EnumJoinRoot)
|
||||
{
|
||||
if (v.DistanceSquared(item4.Position) <= IdentityDistance)
|
||||
{
|
||||
jointsD.Joins.Add(new JointD(JoinRoot, item, num2, item2));
|
||||
if (!list.Contains(num))
|
||||
{
|
||||
list.Add(num);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
num2++;
|
||||
}
|
||||
}
|
||||
else if (!list.Contains(num))
|
||||
{
|
||||
list.Add(num);
|
||||
}
|
||||
num++;
|
||||
}
|
||||
for (int num3 = list.Count - 1; num3 > -1; num3--)
|
||||
{
|
||||
list2.RemoveAt(list[num3]);
|
||||
}
|
||||
}
|
||||
GetJointsD(list2, jointsD, list);
|
||||
return jointsD;
|
||||
}
|
||||
|
||||
private static void GetJointsD(List<Difs> dl, JointsD jsd, List<int> del)
|
||||
{
|
||||
int num = -1;
|
||||
int num2 = 0;
|
||||
while (num != jsd.Joins.Count)
|
||||
{
|
||||
num = jsd.Joins.Count;
|
||||
for (int i = num2; i < num; i++)
|
||||
{
|
||||
Difs difs = jsd.Joins[i].Difs1;
|
||||
foreach (Par item in difs.EnumAllPar())
|
||||
{
|
||||
int num3 = 0;
|
||||
del.Clear();
|
||||
foreach (Difs item2 in dl)
|
||||
{
|
||||
if (difs != item2)
|
||||
{
|
||||
int num4 = 0;
|
||||
foreach (Joi item3 in item.JP)
|
||||
{
|
||||
Vector2D v = item.ToGlobal(item3.Joint);
|
||||
foreach (Par item4 in item2.EnumJoinRoot)
|
||||
{
|
||||
if (v.DistanceSquared(item4.Position) <= IdentityDistance)
|
||||
{
|
||||
jsd.Joins.Add(new JointD(difs, item, num4, item2));
|
||||
if (!del.Contains(num3))
|
||||
{
|
||||
del.Add(num3);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
num4++;
|
||||
}
|
||||
}
|
||||
else if (!del.Contains(num3))
|
||||
{
|
||||
del.Add(num3);
|
||||
}
|
||||
num3++;
|
||||
}
|
||||
for (int num5 = del.Count - 1; num5 > -1; num5--)
|
||||
{
|
||||
dl.RemoveAt(del[num5]);
|
||||
}
|
||||
}
|
||||
}
|
||||
num2 = num;
|
||||
}
|
||||
}
|
||||
private static void GetJointsD(List<Difs> dl, JointsD jsd, List<int> del)
|
||||
{
|
||||
int num = -1;
|
||||
int num2 = 0;
|
||||
while (num != jsd.Joins.Count)
|
||||
{
|
||||
num = jsd.Joins.Count;
|
||||
for (int i = num2; i < num; i++)
|
||||
{
|
||||
Difs difs = jsd.Joins[i].Difs1;
|
||||
foreach (Par item in difs.EnumAllPar())
|
||||
{
|
||||
int num3 = 0;
|
||||
del.Clear();
|
||||
foreach (Difs item2 in dl)
|
||||
{
|
||||
if (difs != item2)
|
||||
{
|
||||
int num4 = 0;
|
||||
foreach (Joi item3 in item.JP)
|
||||
{
|
||||
Vector2D v = item.ToGlobal(item3.Joint);
|
||||
foreach (Par item4 in item2.EnumJoinRoot)
|
||||
{
|
||||
if (v.DistanceSquared(item4.Position) <= IdentityDistance)
|
||||
{
|
||||
jsd.Joins.Add(new JointD(difs, item, num4, item2));
|
||||
if (!del.Contains(num3))
|
||||
{
|
||||
del.Add(num3);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
num4++;
|
||||
}
|
||||
}
|
||||
else if (!del.Contains(num3))
|
||||
{
|
||||
del.Add(num3);
|
||||
}
|
||||
num3++;
|
||||
}
|
||||
for (int num5 = del.Count - 1; num5 > -1; num5--)
|
||||
{
|
||||
dl.RemoveAt(del[num5]);
|
||||
}
|
||||
}
|
||||
}
|
||||
num2 = num;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,30 +1,31 @@
|
||||
using System;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
[Serializable]
|
||||
public class Joint
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
public Par Par0;
|
||||
[Serializable]
|
||||
public class Joint
|
||||
{
|
||||
public Par Par0;
|
||||
|
||||
public int Index;
|
||||
public int Index;
|
||||
|
||||
public Par Par1;
|
||||
public Par Par1;
|
||||
|
||||
public Joint(Par Par0, int Index, Par Par1)
|
||||
{
|
||||
this.Par0 = Par0;
|
||||
this.Index = Index;
|
||||
this.Par1 = Par1;
|
||||
}
|
||||
public Joint(Par Par0, int Index, Par Par1)
|
||||
{
|
||||
this.Par0 = Par0;
|
||||
this.Index = Index;
|
||||
this.Par1 = Par1;
|
||||
}
|
||||
|
||||
public void JoinP()
|
||||
{
|
||||
Par0.SetJointP(Index, Par1);
|
||||
}
|
||||
public void JoinP()
|
||||
{
|
||||
Par0.SetJointP(Index, Par1);
|
||||
}
|
||||
|
||||
public void JoinPA()
|
||||
{
|
||||
Par0.SetJointPA(Index, Par1);
|
||||
}
|
||||
public void JoinPA()
|
||||
{
|
||||
Par0.SetJointPA(Index, Par1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,72 +1,73 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
[Serializable]
|
||||
public class JointD
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
public Difs Difs0;
|
||||
[Serializable]
|
||||
public class JointD
|
||||
{
|
||||
public Difs Difs0;
|
||||
|
||||
public List<int> Path0;
|
||||
public List<int> Path0;
|
||||
|
||||
public int Index;
|
||||
public int Index;
|
||||
|
||||
public Difs Difs1;
|
||||
public Difs Difs1;
|
||||
|
||||
public JointD(Difs Difs0, Par Par0, int Index, Difs Difs1)
|
||||
{
|
||||
this.Difs0 = Difs0;
|
||||
Path0 = Par0.GetPath();
|
||||
this.Index = Index;
|
||||
this.Difs1 = Difs1;
|
||||
}
|
||||
public JointD(Difs Difs0, Par Par0, int Index, Difs Difs1)
|
||||
{
|
||||
this.Difs0 = Difs0;
|
||||
Path0 = Par0.GetPath();
|
||||
this.Index = Index;
|
||||
this.Difs1 = Difs1;
|
||||
}
|
||||
|
||||
public JointD(Difs Difs1)
|
||||
{
|
||||
this.Difs1 = Difs1;
|
||||
}
|
||||
public JointD(Difs Difs1)
|
||||
{
|
||||
this.Difs1 = Difs1;
|
||||
}
|
||||
|
||||
public void JoinP()
|
||||
{
|
||||
Difs0.Current.GetPar(Path0).SetJointP(Index, Difs1.CurJoinRoot);
|
||||
Difs1.JoinPA();
|
||||
}
|
||||
public void JoinP()
|
||||
{
|
||||
Difs0.Current.GetPar(Path0).SetJointP(Index, Difs1.CurJoinRoot);
|
||||
Difs1.JoinPA();
|
||||
}
|
||||
|
||||
public void JoinPA()
|
||||
{
|
||||
Difs0.Current.GetPar(Path0).SetJointPA(Index, Difs1.CurJoinRoot);
|
||||
Difs1.JoinPA();
|
||||
}
|
||||
public void JoinPA()
|
||||
{
|
||||
Difs0.Current.GetPar(Path0).SetJointPA(Index, Difs1.CurJoinRoot);
|
||||
Difs1.JoinPA();
|
||||
}
|
||||
|
||||
public void JoinPall()
|
||||
{
|
||||
foreach (Par item in Difs1.EnumJoinRoot)
|
||||
{
|
||||
Difs0.Current.GetPar(Path0).SetJointP(Index, item);
|
||||
}
|
||||
foreach (Pars item2 in Difs1.EnumAllPars())
|
||||
{
|
||||
Difs1.JoinPA(item2);
|
||||
}
|
||||
}
|
||||
public void JoinPall()
|
||||
{
|
||||
foreach (Par item in Difs1.EnumJoinRoot)
|
||||
{
|
||||
Difs0.Current.GetPar(Path0).SetJointP(Index, item);
|
||||
}
|
||||
foreach (Pars item2 in Difs1.EnumAllPars())
|
||||
{
|
||||
Difs1.JoinPA(item2);
|
||||
}
|
||||
}
|
||||
|
||||
public void JoinPAall()
|
||||
{
|
||||
foreach (Par item in Difs1.EnumJoinRoot)
|
||||
{
|
||||
Difs0.Current.GetPar(Path0).SetJointPA(Index, item);
|
||||
}
|
||||
foreach (Pars item2 in Difs1.EnumAllPars())
|
||||
{
|
||||
Difs1.JoinPA(item2);
|
||||
}
|
||||
}
|
||||
public void JoinPAall()
|
||||
{
|
||||
foreach (Par item in Difs1.EnumJoinRoot)
|
||||
{
|
||||
Difs0.Current.GetPar(Path0).SetJointPA(Index, item);
|
||||
}
|
||||
foreach (Pars item2 in Difs1.EnumAllPars())
|
||||
{
|
||||
Difs1.JoinPA(item2);
|
||||
}
|
||||
}
|
||||
|
||||
public void Set(JointS 接続元)
|
||||
{
|
||||
Difs0 = 接続元.Difs;
|
||||
Path0 = 接続元.Path;
|
||||
Index = 接続元.Index;
|
||||
}
|
||||
public void Set(JointS 接続元)
|
||||
{
|
||||
Difs0 = 接続元.Difs;
|
||||
Path0 = 接続元.Path;
|
||||
Index = 接続元.Index;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,46 +1,47 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
[Serializable]
|
||||
public class Joints
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
public List<Joint> Joins = new List<Joint>();
|
||||
[Serializable]
|
||||
public class Joints
|
||||
{
|
||||
public List<Joint> Joins = new List<Joint>();
|
||||
|
||||
public void JoinP()
|
||||
{
|
||||
foreach (Joint join in Joins)
|
||||
{
|
||||
join.JoinP();
|
||||
}
|
||||
}
|
||||
public void JoinP()
|
||||
{
|
||||
foreach (Joint join in Joins)
|
||||
{
|
||||
join.JoinP();
|
||||
}
|
||||
}
|
||||
|
||||
public void JoinPA()
|
||||
{
|
||||
foreach (Joint join in Joins)
|
||||
{
|
||||
join.JoinPA();
|
||||
}
|
||||
}
|
||||
}
|
||||
[Serializable]
|
||||
public class JointS
|
||||
{
|
||||
public Difs Difs;
|
||||
public void JoinPA()
|
||||
{
|
||||
foreach (Joint join in Joins)
|
||||
{
|
||||
join.JoinPA();
|
||||
}
|
||||
}
|
||||
}
|
||||
[Serializable]
|
||||
public class JointS
|
||||
{
|
||||
public Difs Difs;
|
||||
|
||||
public List<int> Path;
|
||||
public List<int> Path;
|
||||
|
||||
public int Index;
|
||||
public int Index;
|
||||
|
||||
public JointS()
|
||||
{
|
||||
}
|
||||
public JointS()
|
||||
{
|
||||
}
|
||||
|
||||
public JointS(Difs Difs, Par Par, int Index)
|
||||
{
|
||||
this.Difs = Difs;
|
||||
Path = Par.GetPath();
|
||||
this.Index = Index;
|
||||
}
|
||||
public JointS(Difs Difs, Par Par, int Index)
|
||||
{
|
||||
this.Difs = Difs;
|
||||
Path = Par.GetPath();
|
||||
this.Index = Index;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,42 +1,43 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
[Serializable]
|
||||
public class JointsD
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
public List<JointD> Joins = new List<JointD>();
|
||||
[Serializable]
|
||||
public class JointsD
|
||||
{
|
||||
public List<JointD> Joins = new List<JointD>();
|
||||
|
||||
public void JoinP()
|
||||
{
|
||||
foreach (JointD join in Joins)
|
||||
{
|
||||
join.JoinP();
|
||||
}
|
||||
}
|
||||
public void JoinP()
|
||||
{
|
||||
foreach (JointD join in Joins)
|
||||
{
|
||||
join.JoinP();
|
||||
}
|
||||
}
|
||||
|
||||
public void JoinPA()
|
||||
{
|
||||
foreach (JointD join in Joins)
|
||||
{
|
||||
join.JoinPA();
|
||||
}
|
||||
}
|
||||
public void JoinPA()
|
||||
{
|
||||
foreach (JointD join in Joins)
|
||||
{
|
||||
join.JoinPA();
|
||||
}
|
||||
}
|
||||
|
||||
public void JoinPall()
|
||||
{
|
||||
foreach (JointD join in Joins)
|
||||
{
|
||||
join.JoinPall();
|
||||
}
|
||||
}
|
||||
public void JoinPall()
|
||||
{
|
||||
foreach (JointD join in Joins)
|
||||
{
|
||||
join.JoinPall();
|
||||
}
|
||||
}
|
||||
|
||||
public void JoinPAall()
|
||||
{
|
||||
foreach (JointD join in Joins)
|
||||
{
|
||||
join.JoinPAall();
|
||||
}
|
||||
}
|
||||
public void JoinPAall()
|
||||
{
|
||||
foreach (JointD join in Joins)
|
||||
{
|
||||
join.JoinPAall();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,181 +1,182 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
public class Lab
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
private ParT parT;
|
||||
public class Lab
|
||||
{
|
||||
private ParT parT;
|
||||
|
||||
private Med Med;
|
||||
private Med Med;
|
||||
|
||||
private Are Are;
|
||||
private Are Are;
|
||||
|
||||
private double Width;
|
||||
private double Width;
|
||||
|
||||
private bool Input;
|
||||
private bool Input;
|
||||
|
||||
private double Min;
|
||||
private double Min;
|
||||
|
||||
public ParT ParT => parT;
|
||||
public ParT ParT => parT;
|
||||
|
||||
public string Text
|
||||
{
|
||||
get
|
||||
{
|
||||
return parT.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
public string Text
|
||||
{
|
||||
get
|
||||
{
|
||||
return parT.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
//TODO fix?
|
||||
//if (!Med.BaseControl.Contains(tb))
|
||||
{
|
||||
SetText(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SetText(string Text)
|
||||
{
|
||||
parT.Text = Text;
|
||||
SetRect();
|
||||
}
|
||||
|
||||
public Lab(Med Med, Are Are, string Name, ref Vector2D Position, double Size, double Width, Font Font, double TextSize, string Text, ref Color TextColor, ref Color ShadColor, ref Color BackColor, ref Color FramColor, bool Input)
|
||||
{
|
||||
//Note: Input is always false
|
||||
Setting(Med, Are, Name, ref Position, Size, Width, Font, TextSize, Text, ref TextColor, ref ShadColor, ref BackColor, ref FramColor, Input);
|
||||
}
|
||||
|
||||
public Lab(Med Med, Are Are, string Name, Vector2D Position, double Size, double Width, Font Font, double TextSize, string Text, Color TextColor, Color ShadColor, Color BackColor, Color FramColor, bool Input)
|
||||
{
|
||||
Setting(Med, Are, Name, ref Position, Size, Width, Font, TextSize, Text, ref TextColor, ref ShadColor, ref BackColor, ref FramColor, Input);
|
||||
}
|
||||
|
||||
private void Setting(Med Med, Are Are, string Name, ref Vector2D Position, double Size, double Width, Font Font, double TextSize, string Text, ref Color TextColor, ref Color ShadColor, ref Color BackColor, ref Color FramColor, bool Input)
|
||||
{
|
||||
this.Med = Med;
|
||||
this.Are = Are;
|
||||
this.Width = Width;
|
||||
this.Input = Input;
|
||||
|
||||
Out[] array = new Out[1] { Shas.Get正方形() };
|
||||
if (FramColor == Color.Empty || FramColor == Color.Transparent)
|
||||
{
|
||||
array.OutlineFalse();
|
||||
}
|
||||
parT = new ParT
|
||||
{
|
||||
Tag = Name,
|
||||
InitializeOP = array,
|
||||
BasePointBase = array[0].ps[0],
|
||||
PositionBase = Position,
|
||||
SizeBase = Size,
|
||||
Closed = true,
|
||||
BrushColor = BackColor,
|
||||
PenColor = FramColor,
|
||||
Font = Font,
|
||||
FontSize = TextSize,
|
||||
TextColor = TextColor,
|
||||
Text = "A"
|
||||
};
|
||||
if (ShadColor != Color.Empty)
|
||||
{
|
||||
parT.ShadBrush = new SolidBrush(ShadColor);
|
||||
}
|
||||
SetRect();
|
||||
Min = parT.RectSize.Y;
|
||||
SetText(Text);
|
||||
}
|
||||
|
||||
private void Lab_Resize(object sender, EventArgs e)
|
||||
{
|
||||
//TODO fix?
|
||||
//if (!Med.BaseControl.Contains(tb))
|
||||
{
|
||||
SetText(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
//Med.BaseControl.Controls.Remove(tb);
|
||||
//SetText(tb.Text);
|
||||
}
|
||||
|
||||
private void SetText(string Text)
|
||||
{
|
||||
parT.Text = Text;
|
||||
SetRect();
|
||||
}
|
||||
public void SetHitColor(Med Med)
|
||||
{
|
||||
if (parT.HitColor != Color.Transparent)
|
||||
{
|
||||
Med.RemUniqueColor(parT.HitColor);
|
||||
}
|
||||
parT.HitColor = Med.GetUniqueColor();
|
||||
}
|
||||
|
||||
public Lab(Med Med, Are Are, string Name, ref Vector2D Position, double Size, double Width, Font Font, double TextSize, string Text, ref Color TextColor, ref Color ShadColor, ref Color BackColor, ref Color FramColor, bool Input)
|
||||
{
|
||||
//Note: Input is always false
|
||||
Setting(Med, Are, Name, ref Position, Size, Width, Font, TextSize, Text, ref TextColor, ref ShadColor, ref BackColor, ref FramColor, Input);
|
||||
}
|
||||
private void SetRect()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(parT.Text))
|
||||
{
|
||||
parT.RectSize = new Vector2D(Width, 10.0);
|
||||
Vector2D_2 stringRect = parT.GetStringRect(Are.DisUnit, Are.GD);
|
||||
double x = ((stringRect.v2.X > Min) ? stringRect.v2.X : Min) + 0.07;
|
||||
parT.RectSize = new Vector2D(x, stringRect.v2.Y);
|
||||
}
|
||||
else
|
||||
{
|
||||
double x2 = Min + 0.07;
|
||||
parT.RectSize = new Vector2D(x2, Min);
|
||||
}
|
||||
parT.OP[0].ps[0] = new Vector2D(0.0, 0.0);
|
||||
parT.OP[0].ps[1] = new Vector2D(parT.RectSize.X, 0.0);
|
||||
parT.OP[0].ps[2] = new Vector2D(parT.RectSize.X, parT.RectSize.Y);
|
||||
parT.OP[0].ps[3] = new Vector2D(0.0, parT.RectSize.Y);
|
||||
}
|
||||
|
||||
public Lab(Med Med, Are Are, string Name, Vector2D Position, double Size, double Width, Font Font, double TextSize, string Text, Color TextColor, Color ShadColor, Color BackColor, Color FramColor, bool Input)
|
||||
{
|
||||
Setting(Med, Are, Name, ref Position, Size, Width, Font, TextSize, Text, ref TextColor, ref ShadColor, ref BackColor, ref FramColor, Input);
|
||||
}
|
||||
private void SetRectT()
|
||||
{
|
||||
/*
|
||||
double resMag = Med.ResMag;
|
||||
Vector2D vector2D = (parT.Position + Are.GetPosition()) * Med.Unit / resMag + Med.ResVector;
|
||||
|
||||
private void Setting(Med Med, Are Are, string Name, ref Vector2D Position, double Size, double Width, Font Font, double TextSize, string Text, ref Color TextColor, ref Color ShadColor, ref Color BackColor, ref Color FramColor, bool Input)
|
||||
{
|
||||
this.Med = Med;
|
||||
this.Are = Are;
|
||||
this.Width = Width;
|
||||
this.Input = Input;
|
||||
tb.Location = new Point((int)vector2D.X - 1, (int)vector2D.Y - 1);
|
||||
double num = parT.Size * Med.Unit;
|
||||
|
||||
Out[] array = new Out[1] { Shas.Get正方形() };
|
||||
if (FramColor == Color.Empty || FramColor == Color.Transparent)
|
||||
{
|
||||
array.OutlineFalse();
|
||||
}
|
||||
parT = new ParT
|
||||
{
|
||||
Tag = Name,
|
||||
InitializeOP = array,
|
||||
BasePointBase = array[0].ps[0],
|
||||
PositionBase = Position,
|
||||
SizeBase = Size,
|
||||
Closed = true,
|
||||
BrushColor = BackColor,
|
||||
PenColor = FramColor,
|
||||
Font = Font,
|
||||
FontSize = TextSize,
|
||||
TextColor = TextColor,
|
||||
Text = "A"
|
||||
};
|
||||
if (ShadColor != Color.Empty)
|
||||
{
|
||||
parT.ShadBrush = new SolidBrush(ShadColor);
|
||||
}
|
||||
SetRect();
|
||||
Min = parT.RectSize.Y;
|
||||
SetText(Text);
|
||||
}
|
||||
if (tb.Font != null)
|
||||
{
|
||||
tb.Font.Dispose();
|
||||
}
|
||||
tb.Font = new Font(parT.Font.FontFamily, (float)(parT.FontSize * num / resMag));
|
||||
Vector2D vector2D2 = parT.RectSize * num / resMag;
|
||||
tb.Size = new Size((int)(vector2D2.X + 2.0), (int)(vector2D2.Y + 10.0));*/
|
||||
}
|
||||
|
||||
private void Lab_Resize(object sender, EventArgs e)
|
||||
{
|
||||
//TODO fix?
|
||||
//Med.BaseControl.Controls.Remove(tb);
|
||||
//SetText(tb.Text);
|
||||
}
|
||||
|
||||
public void SetHitColor(Med Med)
|
||||
{
|
||||
if (parT.HitColor != Color.Transparent)
|
||||
{
|
||||
Med.RemUniqueColor(parT.HitColor);
|
||||
}
|
||||
parT.HitColor = Med.GetUniqueColor();
|
||||
}
|
||||
|
||||
private void SetRect()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(parT.Text))
|
||||
{
|
||||
parT.RectSize = new Vector2D(Width, 10.0);
|
||||
Vector2D_2 stringRect = parT.GetStringRect(Are.DisUnit, Are.GD);
|
||||
double x = ((stringRect.v2.X > Min) ? stringRect.v2.X : Min) + 0.07;
|
||||
parT.RectSize = new Vector2D(x, stringRect.v2.Y);
|
||||
}
|
||||
else
|
||||
{
|
||||
double x2 = Min + 0.07;
|
||||
parT.RectSize = new Vector2D(x2, Min);
|
||||
}
|
||||
parT.OP[0].ps[0] = new Vector2D(0.0, 0.0);
|
||||
parT.OP[0].ps[1] = new Vector2D(parT.RectSize.X, 0.0);
|
||||
parT.OP[0].ps[2] = new Vector2D(parT.RectSize.X, parT.RectSize.Y);
|
||||
parT.OP[0].ps[3] = new Vector2D(0.0, parT.RectSize.Y);
|
||||
}
|
||||
|
||||
private void SetRectT()
|
||||
{
|
||||
/*
|
||||
double resMag = Med.ResMag;
|
||||
Vector2D vector2D = (parT.Position + Are.GetPosition()) * Med.Unit / resMag + Med.ResVector;
|
||||
|
||||
tb.Location = new Point((int)vector2D.X - 1, (int)vector2D.Y - 1);
|
||||
double num = parT.Size * Med.Unit;
|
||||
|
||||
if (tb.Font != null)
|
||||
{
|
||||
tb.Font.Dispose();
|
||||
}
|
||||
tb.Font = new Font(parT.Font.FontFamily, (float)(parT.FontSize * num / resMag));
|
||||
Vector2D vector2D2 = parT.RectSize * num / resMag;
|
||||
tb.Size = new Size((int)(vector2D2.X + 2.0), (int)(vector2D2.Y + 10.0));*/
|
||||
}
|
||||
|
||||
public bool Double(ref Color HitColor)
|
||||
{
|
||||
//TODO fix?
|
||||
//if (Input && parT.HitColor == HitColor && !Med.BaseControl.Controls.Contains(tb))
|
||||
/*{
|
||||
tb.Text = parT.Text;
|
||||
parT.Text = "";
|
||||
SetRectT();
|
||||
//Med.BaseControl.Controls.Add(tb);
|
||||
tb.SelectAll();
|
||||
tb.Focus();
|
||||
tb.BringToFront();
|
||||
return true;
|
||||
}*/
|
||||
return false;
|
||||
}
|
||||
|
||||
public void Click(ref Color HitColor)
|
||||
{
|
||||
//TODO fix?
|
||||
/*if (Input && parT.HitColor != HitColor && Med.BaseControl.Controls.Contains(tb))
|
||||
{
|
||||
//Med.BaseControl.Controls.Remove(tb);
|
||||
SetText(tb.Text);
|
||||
}*/
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
parT.Dispose();
|
||||
if (Input)
|
||||
{
|
||||
public bool Double(ref Color HitColor)
|
||||
{
|
||||
//TODO fix?
|
||||
//((Control)Med.BaseControl).Resize -= Lab_Resize;
|
||||
}
|
||||
}
|
||||
//if (Input && parT.HitColor == HitColor && !Med.BaseControl.Controls.Contains(tb))
|
||||
/*{
|
||||
tb.Text = parT.Text;
|
||||
parT.Text = "";
|
||||
SetRectT();
|
||||
//Med.BaseControl.Controls.Add(tb);
|
||||
tb.SelectAll();
|
||||
tb.Focus();
|
||||
tb.BringToFront();
|
||||
return true;
|
||||
}*/
|
||||
return false;
|
||||
}
|
||||
|
||||
public void Click(ref Color HitColor)
|
||||
{
|
||||
//TODO fix?
|
||||
/*if (Input && parT.HitColor != HitColor && Med.BaseControl.Controls.Contains(tb))
|
||||
{
|
||||
//Med.BaseControl.Controls.Remove(tb);
|
||||
SetText(tb.Text);
|
||||
}*/
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
parT.Dispose();
|
||||
if (Input)
|
||||
{
|
||||
//TODO fix?
|
||||
//((Control)Med.BaseControl).Resize -= Lab_Resize;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,79 +1,80 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
public class Labs
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
private OrderedDictionary<string, Lab> labs = new OrderedDictionary<string, Lab>();
|
||||
public class Labs
|
||||
{
|
||||
private OrderedDictionary<string, Lab> labs = new OrderedDictionary<string, Lab>();
|
||||
|
||||
private Med Med;
|
||||
private Med Med;
|
||||
|
||||
private Are Are;
|
||||
private Are Are;
|
||||
|
||||
public Lab this[string Name] => labs[Name];
|
||||
public Lab this[string Name] => labs[Name];
|
||||
|
||||
public Labs(Med Med, Are Are)
|
||||
{
|
||||
this.Med = Med;
|
||||
this.Are = Are;
|
||||
}
|
||||
public Labs(Med Med, Are Are)
|
||||
{
|
||||
this.Med = Med;
|
||||
this.Are = Are;
|
||||
}
|
||||
|
||||
public void Add(string Name, Vector2D Position, double Size, double Width, Font Font, double TextSize, string Text, Color TextColor, Color ShadColor, Color BackColor, Color FramColor, bool Input)
|
||||
{
|
||||
labs.Add(Name, new Lab(Med, Are, Name, ref Position, Size, Width, Font, TextSize, Text, ref TextColor, ref ShadColor, ref BackColor, ref FramColor, Input));
|
||||
}
|
||||
public void Add(string Name, Vector2D Position, double Size, double Width, Font Font, double TextSize, string Text, Color TextColor, Color ShadColor, Color BackColor, Color FramColor, bool Input)
|
||||
{
|
||||
labs.Add(Name, new Lab(Med, Are, Name, ref Position, Size, Width, Font, TextSize, Text, ref TextColor, ref ShadColor, ref BackColor, ref FramColor, Input));
|
||||
}
|
||||
|
||||
public void Add(string Name, ref Vector2D Position, double Size, double Width, Font Font, double TextSize, string Text, ref Color TextColor, ref Color ShadColor, ref Color BackColor, ref Color FramColor, bool Input)
|
||||
{
|
||||
labs.Add(Name, new Lab(Med, Are, Name, ref Position, Size, Width, Font, TextSize, Text, ref TextColor, ref ShadColor, ref BackColor, ref FramColor, Input));
|
||||
}
|
||||
public void Add(string Name, ref Vector2D Position, double Size, double Width, Font Font, double TextSize, string Text, ref Color TextColor, ref Color ShadColor, ref Color BackColor, ref Color FramColor, bool Input)
|
||||
{
|
||||
labs.Add(Name, new Lab(Med, Are, Name, ref Position, Size, Width, Font, TextSize, Text, ref TextColor, ref ShadColor, ref BackColor, ref FramColor, Input));
|
||||
}
|
||||
|
||||
public void Double(ref Color HitColor)
|
||||
{
|
||||
using IEnumerator<Lab> enumerator = labs.Values.GetEnumerator();
|
||||
while (enumerator.MoveNext() && !enumerator.Current.Double(ref HitColor))
|
||||
{
|
||||
}
|
||||
}
|
||||
public void Double(ref Color HitColor)
|
||||
{
|
||||
using IEnumerator<Lab> enumerator = labs.Values.GetEnumerator();
|
||||
while (enumerator.MoveNext() && !enumerator.Current.Double(ref HitColor))
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public void Click(ref Color HitColor)
|
||||
{
|
||||
foreach (Lab value in labs.Values)
|
||||
{
|
||||
value.Click(ref HitColor);
|
||||
}
|
||||
}
|
||||
public void Click(ref Color HitColor)
|
||||
{
|
||||
foreach (Lab value in labs.Values)
|
||||
{
|
||||
value.Click(ref HitColor);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetHitColor(Med Med)
|
||||
{
|
||||
foreach (Lab value in labs.Values)
|
||||
{
|
||||
value.SetHitColor(Med);
|
||||
}
|
||||
}
|
||||
public void SetHitColor(Med Med)
|
||||
{
|
||||
foreach (Lab value in labs.Values)
|
||||
{
|
||||
value.SetHitColor(Med);
|
||||
}
|
||||
}
|
||||
|
||||
public void Draw(Are Are)
|
||||
{
|
||||
foreach (Lab value in labs.Values)
|
||||
{
|
||||
Are.Draw(value.ParT);
|
||||
}
|
||||
}
|
||||
public void Draw(Are Are)
|
||||
{
|
||||
foreach (Lab value in labs.Values)
|
||||
{
|
||||
Are.Draw(value.ParT);
|
||||
}
|
||||
}
|
||||
|
||||
public void Draw(AreM AreM)
|
||||
{
|
||||
foreach (Lab value in labs.Values)
|
||||
{
|
||||
AreM.Draw(value.ParT);
|
||||
}
|
||||
}
|
||||
public void Draw(AreM AreM)
|
||||
{
|
||||
foreach (Lab value in labs.Values)
|
||||
{
|
||||
AreM.Draw(value.ParT);
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
foreach (Lab value in labs.Values)
|
||||
{
|
||||
value.Dispose();
|
||||
}
|
||||
}
|
||||
public void Dispose()
|
||||
{
|
||||
foreach (Lab value in labs.Values)
|
||||
{
|
||||
value.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,98 +1,99 @@
|
||||
using System;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
//TODO remove these...
|
||||
public static class Math
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
public static double RoundDown(this double Value, int Digits)
|
||||
//TODO remove these...
|
||||
public static class Math
|
||||
{
|
||||
double num = System.Math.Pow(10.0, Digits);
|
||||
if (!(Value > 0.0))
|
||||
public static double RoundDown(this double Value, int Digits)
|
||||
{
|
||||
return System.Math.Ceiling(Value * num) / num;
|
||||
double num = System.Math.Pow(10.0, Digits);
|
||||
if (!(Value > 0.0))
|
||||
{
|
||||
return System.Math.Ceiling(Value * num) / num;
|
||||
}
|
||||
return System.Math.Floor(Value * num) / num;
|
||||
}
|
||||
return System.Math.Floor(Value * num) / num;
|
||||
}
|
||||
|
||||
public static double Inverse(this double Rate)
|
||||
{
|
||||
if (Rate == 0.0)
|
||||
public static double Inverse(this double Rate)
|
||||
{
|
||||
return 1.0;
|
||||
if (Rate == 0.0)
|
||||
{
|
||||
return 1.0;
|
||||
}
|
||||
return (double)System.Math.Sign(Rate) - Rate;
|
||||
}
|
||||
return (double)System.Math.Sign(Rate) - Rate;
|
||||
}
|
||||
|
||||
public static double Reciprocal(this double Rate)
|
||||
{
|
||||
if (Rate == 0.0)
|
||||
public static double Reciprocal(this double Rate)
|
||||
{
|
||||
return 1.0;
|
||||
if (Rate == 0.0)
|
||||
{
|
||||
return 1.0;
|
||||
}
|
||||
return 1.0 / Rate;
|
||||
}
|
||||
return 1.0 / Rate;
|
||||
public static double ToRadian(this double Degree)
|
||||
{
|
||||
return System.Math.PI * Degree / 180.0;
|
||||
}
|
||||
public static double ToDegree(this double Radian)
|
||||
{
|
||||
return Radian * 180.0 / System.Math.PI;
|
||||
}
|
||||
public static double Pow(this double x, double n)
|
||||
{
|
||||
return System.Math.Pow(x, n);
|
||||
}
|
||||
|
||||
public static double Sin(this double θ)
|
||||
{
|
||||
return System.Math.Sin(θ);
|
||||
}
|
||||
|
||||
public static double Abs(this double x)
|
||||
{
|
||||
return System.Math.Abs(x);
|
||||
}
|
||||
|
||||
public static int Abs(this int x)
|
||||
{
|
||||
return System.Math.Abs(x);
|
||||
}
|
||||
|
||||
public static int Sign(this double x)
|
||||
{
|
||||
return System.Math.Sign(x);
|
||||
}
|
||||
|
||||
public static int Sign(this int x)
|
||||
{
|
||||
return System.Math.Sign(x);
|
||||
}
|
||||
|
||||
public static double Sqrt(this double x)
|
||||
{
|
||||
return System.Math.Sqrt(x);
|
||||
}
|
||||
|
||||
public static double Max(this double a, double b)
|
||||
{
|
||||
return System.Math.Max(a, b);
|
||||
}
|
||||
|
||||
public static int Clamp(this int Value, int Min, int Max)
|
||||
{
|
||||
return System.Math.Min(Max, System.Math.Max(Min, Value));
|
||||
}
|
||||
|
||||
public static double Clamp(this double Value, double Min, double Max)
|
||||
{
|
||||
return System.Math.Min(Max, System.Math.Max(Min, Value));
|
||||
}
|
||||
|
||||
public static int Limit(this int Value, int Sta, int Les)
|
||||
{
|
||||
return System.Math.Min(Les-1, System.Math.Max(Sta, Value));
|
||||
}
|
||||
|
||||
}
|
||||
public static double ToRadian(this double Degree)
|
||||
{
|
||||
return System.Math.PI * Degree / 180.0;
|
||||
}
|
||||
public static double ToDegree(this double Radian)
|
||||
{
|
||||
return Radian * 180.0 / System.Math.PI;
|
||||
}
|
||||
public static double Pow(this double x, double n)
|
||||
{
|
||||
return System.Math.Pow(x, n);
|
||||
}
|
||||
|
||||
public static double Sin(this double θ)
|
||||
{
|
||||
return System.Math.Sin(θ);
|
||||
}
|
||||
|
||||
public static double Abs(this double x)
|
||||
{
|
||||
return System.Math.Abs(x);
|
||||
}
|
||||
|
||||
public static int Abs(this int x)
|
||||
{
|
||||
return System.Math.Abs(x);
|
||||
}
|
||||
|
||||
public static int Sign(this double x)
|
||||
{
|
||||
return System.Math.Sign(x);
|
||||
}
|
||||
|
||||
public static int Sign(this int x)
|
||||
{
|
||||
return System.Math.Sign(x);
|
||||
}
|
||||
|
||||
public static double Sqrt(this double x)
|
||||
{
|
||||
return System.Math.Sqrt(x);
|
||||
}
|
||||
|
||||
public static double Max(this double a, double b)
|
||||
{
|
||||
return System.Math.Max(a, b);
|
||||
}
|
||||
|
||||
public static int Clamp(this int Value, int Min, int Max)
|
||||
{
|
||||
return System.Math.Min(Max, System.Math.Max(Min, Value));
|
||||
}
|
||||
|
||||
public static double Clamp(this double Value, double Min, double Max)
|
||||
{
|
||||
return System.Math.Min(Max, System.Math.Max(Min, Value));
|
||||
}
|
||||
|
||||
public static int Limit(this int Value, int Sta, int Les)
|
||||
{
|
||||
return System.Math.Min(Les-1, System.Math.Max(Sta, Value));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,154 +1,155 @@
|
||||
using System;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
public static class Matrix
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
public static MatrixD RotationZ(this double angle)
|
||||
{
|
||||
MatrixD result = default(MatrixD);
|
||||
result.M11 = System.Math.Cos(angle);
|
||||
result.M12 = System.Math.Sin(angle);
|
||||
result.M13 = 0.0;
|
||||
result.M14 = 0.0;
|
||||
result.M21 = 0.0 - result.M12;
|
||||
result.M22 = result.M11;
|
||||
result.M23 = 0.0;
|
||||
result.M24 = 0.0;
|
||||
result.M31 = 0.0;
|
||||
result.M32 = 0.0;
|
||||
result.M33 = 1.0;
|
||||
result.M34 = 0.0;
|
||||
result.M41 = 0.0;
|
||||
result.M42 = 0.0;
|
||||
result.M43 = 0.0;
|
||||
result.M44 = 1.0;
|
||||
return result;
|
||||
}
|
||||
public static class Matrix
|
||||
{
|
||||
public static MatrixD RotationZ(this double angle)
|
||||
{
|
||||
MatrixD result = default(MatrixD);
|
||||
result.M11 = System.Math.Cos(angle);
|
||||
result.M12 = System.Math.Sin(angle);
|
||||
result.M13 = 0.0;
|
||||
result.M14 = 0.0;
|
||||
result.M21 = 0.0 - result.M12;
|
||||
result.M22 = result.M11;
|
||||
result.M23 = 0.0;
|
||||
result.M24 = 0.0;
|
||||
result.M31 = 0.0;
|
||||
result.M32 = 0.0;
|
||||
result.M33 = 1.0;
|
||||
result.M34 = 0.0;
|
||||
result.M41 = 0.0;
|
||||
result.M42 = 0.0;
|
||||
result.M43 = 0.0;
|
||||
result.M44 = 1.0;
|
||||
return result;
|
||||
}
|
||||
|
||||
public static void RotationZ(this double angle, out MatrixD result)
|
||||
{
|
||||
result.M11 = System.Math.Cos(angle);
|
||||
result.M12 = System.Math.Sin(angle);
|
||||
result.M13 = 0.0;
|
||||
result.M14 = 0.0;
|
||||
result.M21 = 0.0 - result.M12;
|
||||
result.M22 = result.M11;
|
||||
result.M23 = 0.0;
|
||||
result.M24 = 0.0;
|
||||
result.M31 = 0.0;
|
||||
result.M32 = 0.0;
|
||||
result.M33 = 1.0;
|
||||
result.M34 = 0.0;
|
||||
result.M41 = 0.0;
|
||||
result.M42 = 0.0;
|
||||
result.M43 = 0.0;
|
||||
result.M44 = 1.0;
|
||||
}
|
||||
public static void RotationZ(this double angle, out MatrixD result)
|
||||
{
|
||||
result.M11 = System.Math.Cos(angle);
|
||||
result.M12 = System.Math.Sin(angle);
|
||||
result.M13 = 0.0;
|
||||
result.M14 = 0.0;
|
||||
result.M21 = 0.0 - result.M12;
|
||||
result.M22 = result.M11;
|
||||
result.M23 = 0.0;
|
||||
result.M24 = 0.0;
|
||||
result.M31 = 0.0;
|
||||
result.M32 = 0.0;
|
||||
result.M33 = 1.0;
|
||||
result.M34 = 0.0;
|
||||
result.M41 = 0.0;
|
||||
result.M42 = 0.0;
|
||||
result.M43 = 0.0;
|
||||
result.M44 = 1.0;
|
||||
}
|
||||
|
||||
public static Vector2D TransformCoordinate(this Vector2D coord, MatrixD transform)
|
||||
{
|
||||
double num = 1.0 / (coord.X * transform.M14 + coord.Y * transform.M24 + transform.M44);
|
||||
return new Vector2D((coord.X * transform.M11 + coord.Y * transform.M21 + transform.M41) * num, (coord.X * transform.M12 + coord.Y * transform.M22 + transform.M42) * num);
|
||||
}
|
||||
public static Vector2D TransformCoordinate(this Vector2D coord, MatrixD transform)
|
||||
{
|
||||
double num = 1.0 / (coord.X * transform.M14 + coord.Y * transform.M24 + transform.M44);
|
||||
return new Vector2D((coord.X * transform.M11 + coord.Y * transform.M21 + transform.M41) * num, (coord.X * transform.M12 + coord.Y * transform.M22 + transform.M42) * num);
|
||||
}
|
||||
|
||||
public static Vector2D TransformCoordinate(ref Vector2D coord, ref MatrixD transform)
|
||||
{
|
||||
double num = 1.0 / (coord.X * transform.M14 + coord.Y * transform.M24 + transform.M44);
|
||||
return new Vector2D((coord.X * transform.M11 + coord.Y * transform.M21 + transform.M41) * num, (coord.X * transform.M12 + coord.Y * transform.M22 + transform.M42) * num);
|
||||
}
|
||||
public static Vector2D TransformCoordinate(ref Vector2D coord, ref MatrixD transform)
|
||||
{
|
||||
double num = 1.0 / (coord.X * transform.M14 + coord.Y * transform.M24 + transform.M44);
|
||||
return new Vector2D((coord.X * transform.M11 + coord.Y * transform.M21 + transform.M41) * num, (coord.X * transform.M12 + coord.Y * transform.M22 + transform.M42) * num);
|
||||
}
|
||||
|
||||
public static void TransformCoordinate(this Vector2D coord, MatrixD transform, out Vector2D result)
|
||||
{
|
||||
double num = 1.0 / (coord.X * transform.M14 + coord.Y * transform.M24 + transform.M44);
|
||||
result.X = (coord.X * transform.M11 + coord.Y * transform.M21 + transform.M41) * num;
|
||||
result.Y = (coord.X * transform.M12 + coord.Y * transform.M22 + transform.M42) * num;
|
||||
}
|
||||
public static void TransformCoordinate(this Vector2D coord, MatrixD transform, out Vector2D result)
|
||||
{
|
||||
double num = 1.0 / (coord.X * transform.M14 + coord.Y * transform.M24 + transform.M44);
|
||||
result.X = (coord.X * transform.M11 + coord.Y * transform.M21 + transform.M41) * num;
|
||||
result.Y = (coord.X * transform.M12 + coord.Y * transform.M22 + transform.M42) * num;
|
||||
}
|
||||
|
||||
public static void TransformCoordinate(ref Vector2D coord, ref MatrixD transform, out Vector2D result)
|
||||
{
|
||||
double num = 1.0 / (coord.X * transform.M14 + coord.Y * transform.M24 + transform.M44);
|
||||
result.X = (coord.X * transform.M11 + coord.Y * transform.M21 + transform.M41) * num;
|
||||
result.Y = (coord.X * transform.M12 + coord.Y * transform.M22 + transform.M42) * num;
|
||||
}
|
||||
public static void TransformCoordinate(ref Vector2D coord, ref MatrixD transform, out Vector2D result)
|
||||
{
|
||||
double num = 1.0 / (coord.X * transform.M14 + coord.Y * transform.M24 + transform.M44);
|
||||
result.X = (coord.X * transform.M11 + coord.Y * transform.M21 + transform.M41) * num;
|
||||
result.Y = (coord.X * transform.M12 + coord.Y * transform.M22 + transform.M42) * num;
|
||||
}
|
||||
|
||||
public static Vector2D[] TransformCoordinate(this Vector2D[] coords, MatrixD transform)
|
||||
{
|
||||
int num = coords.Length;
|
||||
Vector2D[] array = new Vector2D[num];
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
double num2 = 1.0 / (coords[i].X * transform.M14 + coords[i].Y * transform.M24 + transform.M44);
|
||||
array[i].X = (coords[i].X * transform.M11 + coords[i].Y * transform.M21 + transform.M41) * num2;
|
||||
array[i].Y = (coords[i].X * transform.M12 + coords[i].Y * transform.M22 + transform.M42) * num2;
|
||||
}
|
||||
return array;
|
||||
}
|
||||
public static Vector2D[] TransformCoordinate(this Vector2D[] coords, MatrixD transform)
|
||||
{
|
||||
int num = coords.Length;
|
||||
Vector2D[] array = new Vector2D[num];
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
double num2 = 1.0 / (coords[i].X * transform.M14 + coords[i].Y * transform.M24 + transform.M44);
|
||||
array[i].X = (coords[i].X * transform.M11 + coords[i].Y * transform.M21 + transform.M41) * num2;
|
||||
array[i].Y = (coords[i].X * transform.M12 + coords[i].Y * transform.M22 + transform.M42) * num2;
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
public static Vector2D[] TransformCoordinate(this Vector2D[] coords, ref MatrixD transform)
|
||||
{
|
||||
int num = coords.Length;
|
||||
Vector2D[] array = new Vector2D[num];
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
double num2 = 1.0 / (coords[i].X * transform.M14 + coords[i].Y * transform.M24 + transform.M44);
|
||||
array[i].X = (coords[i].X * transform.M11 + coords[i].Y * transform.M21 + transform.M41) * num2;
|
||||
array[i].Y = (coords[i].X * transform.M12 + coords[i].Y * transform.M22 + transform.M42) * num2;
|
||||
}
|
||||
return array;
|
||||
}
|
||||
public static Vector2D[] TransformCoordinate(this Vector2D[] coords, ref MatrixD transform)
|
||||
{
|
||||
int num = coords.Length;
|
||||
Vector2D[] array = new Vector2D[num];
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
double num2 = 1.0 / (coords[i].X * transform.M14 + coords[i].Y * transform.M24 + transform.M44);
|
||||
array[i].X = (coords[i].X * transform.M11 + coords[i].Y * transform.M21 + transform.M41) * num2;
|
||||
array[i].Y = (coords[i].X * transform.M12 + coords[i].Y * transform.M22 + transform.M42) * num2;
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
public static void TransformCoordinate(this Vector2D[] coords, MatrixD transform, out Vector2D[] results)
|
||||
{
|
||||
int num = coords.Length;
|
||||
results = new Vector2D[num];
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
double num2 = 1.0 / (coords[i].X * transform.M14 + coords[i].Y * transform.M24 + transform.M44);
|
||||
results[i].X = (coords[i].X * transform.M11 + coords[i].Y * transform.M21 + transform.M41) * num2;
|
||||
results[i].Y = (coords[i].X * transform.M12 + coords[i].Y * transform.M22 + transform.M42) * num2;
|
||||
}
|
||||
}
|
||||
public static void TransformCoordinate(this Vector2D[] coords, MatrixD transform, out Vector2D[] results)
|
||||
{
|
||||
int num = coords.Length;
|
||||
results = new Vector2D[num];
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
double num2 = 1.0 / (coords[i].X * transform.M14 + coords[i].Y * transform.M24 + transform.M44);
|
||||
results[i].X = (coords[i].X * transform.M11 + coords[i].Y * transform.M21 + transform.M41) * num2;
|
||||
results[i].Y = (coords[i].X * transform.M12 + coords[i].Y * transform.M22 + transform.M42) * num2;
|
||||
}
|
||||
}
|
||||
|
||||
public static void TransformCoordinate(this Vector2D[] coords, ref MatrixD transform, out Vector2D[] results)
|
||||
{
|
||||
int num = coords.Length;
|
||||
results = new Vector2D[num];
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
double num2 = 1.0 / (coords[i].X * transform.M14 + coords[i].Y * transform.M24 + transform.M44);
|
||||
results[i].X = (coords[i].X * transform.M11 + coords[i].Y * transform.M21 + transform.M41) * num2;
|
||||
results[i].Y = (coords[i].X * transform.M12 + coords[i].Y * transform.M22 + transform.M42) * num2;
|
||||
}
|
||||
}
|
||||
public static void TransformCoordinate(this Vector2D[] coords, ref MatrixD transform, out Vector2D[] results)
|
||||
{
|
||||
int num = coords.Length;
|
||||
results = new Vector2D[num];
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
double num2 = 1.0 / (coords[i].X * transform.M14 + coords[i].Y * transform.M24 + transform.M44);
|
||||
results[i].X = (coords[i].X * transform.M11 + coords[i].Y * transform.M21 + transform.M41) * num2;
|
||||
results[i].Y = (coords[i].X * transform.M12 + coords[i].Y * transform.M22 + transform.M42) * num2;
|
||||
}
|
||||
}
|
||||
|
||||
public static Vector2D TransformCoordinateBP(this Vector2D coord, Vector2D BasePoint, MatrixD transform)
|
||||
{
|
||||
Vec.Subtract(ref coord, ref BasePoint, out coord);
|
||||
TransformCoordinate(ref coord, ref transform, out var result);
|
||||
Vec.Add(ref result, ref BasePoint, out result);
|
||||
return result;
|
||||
}
|
||||
public static Vector2D TransformCoordinateBP(this Vector2D coord, Vector2D BasePoint, MatrixD transform)
|
||||
{
|
||||
Vec.Subtract(ref coord, ref BasePoint, out coord);
|
||||
TransformCoordinate(ref coord, ref transform, out var result);
|
||||
Vec.Add(ref result, ref BasePoint, out result);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Vector2D TransformCoordinateBP(ref Vector2D coord, ref Vector2D BasePoint, ref MatrixD transform)
|
||||
{
|
||||
Vec.Subtract(ref coord, ref BasePoint, out var r);
|
||||
TransformCoordinate(ref r, ref transform, out var result);
|
||||
Vec.Add(ref result, ref BasePoint, out result);
|
||||
return result;
|
||||
}
|
||||
public static Vector2D TransformCoordinateBP(ref Vector2D coord, ref Vector2D BasePoint, ref MatrixD transform)
|
||||
{
|
||||
Vec.Subtract(ref coord, ref BasePoint, out var r);
|
||||
TransformCoordinate(ref r, ref transform, out var result);
|
||||
Vec.Add(ref result, ref BasePoint, out result);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static void TransformCoordinateBP(this Vector2D coord, Vector2D BasePoint, MatrixD transform, out Vector2D result)
|
||||
{
|
||||
Vec.Subtract(ref coord, ref BasePoint, out coord);
|
||||
TransformCoordinate(ref coord, ref transform, out result);
|
||||
Vec.Add(ref result, ref BasePoint, out result);
|
||||
}
|
||||
public static void TransformCoordinateBP(this Vector2D coord, Vector2D BasePoint, MatrixD transform, out Vector2D result)
|
||||
{
|
||||
Vec.Subtract(ref coord, ref BasePoint, out coord);
|
||||
TransformCoordinate(ref coord, ref transform, out result);
|
||||
Vec.Add(ref result, ref BasePoint, out result);
|
||||
}
|
||||
|
||||
public static void TransformCoordinateBP(ref Vector2D coord, ref Vector2D BasePoint, ref MatrixD transform, out Vector2D result)
|
||||
{
|
||||
Vec.Subtract(ref coord, ref BasePoint, out var r);
|
||||
TransformCoordinate(ref r, ref transform, out result);
|
||||
Vec.Add(ref result, ref BasePoint, out result);
|
||||
}
|
||||
public static void TransformCoordinateBP(ref Vector2D coord, ref Vector2D BasePoint, ref MatrixD transform, out Vector2D result)
|
||||
{
|
||||
Vec.Subtract(ref coord, ref BasePoint, out var r);
|
||||
TransformCoordinate(ref r, ref transform, out result);
|
||||
Vec.Add(ref result, ref BasePoint, out result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -5,465 +5,466 @@ using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
public class Med
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
public static object obj;
|
||||
public class Med
|
||||
{
|
||||
public static object obj;
|
||||
|
||||
private GlImage baseControl;
|
||||
private GlImage baseControl;
|
||||
|
||||
public double Unit = 1762.4;
|
||||
public double Unit = 1762.4;
|
||||
|
||||
public Rect Base = new Rect(4.0, 3.0, 0.4);
|
||||
public Rect Base = new Rect(4.0, 3.0, 0.4);
|
||||
|
||||
public double DisQuality = 1.0;
|
||||
public double DisQuality = 1.0;
|
||||
|
||||
public double HitAccuracy = 0.5;
|
||||
public double HitAccuracy = 0.5;
|
||||
|
||||
public Bitmap BD;
|
||||
public Bitmap BD;
|
||||
|
||||
public Graphics GD;
|
||||
public Graphics GD;
|
||||
|
||||
public Bitmap BH;
|
||||
public Bitmap BH;
|
||||
|
||||
public Graphics GH;
|
||||
public Graphics GH;
|
||||
|
||||
private Color ClearColor = Color.Transparent;
|
||||
private Color ClearColor = Color.Transparent;
|
||||
|
||||
public bool Drive = true;
|
||||
public bool Drive = true;
|
||||
|
||||
private Size BaseSize = Size.Empty;
|
||||
private Size BaseSize = Size.Empty;
|
||||
|
||||
private double resMag = 1.0;
|
||||
private double resMag = 1.0;
|
||||
|
||||
private Vector2D resVector = Dat.Vec2DZero;
|
||||
private Vector2D resVector = Dat.Vec2DZero;
|
||||
|
||||
private Sce Sce;
|
||||
private Sce Sce;
|
||||
|
||||
private string mode;
|
||||
private string mode;
|
||||
|
||||
public string Modeb;
|
||||
public string Modeb;
|
||||
|
||||
private Dictionary<string, Module> Modes;
|
||||
private Dictionary<string, Module> Modes;
|
||||
|
||||
private Func<Med, Dictionary<string, Module>> GetModes;
|
||||
private Func<Med, Dictionary<string, Module>> GetModes;
|
||||
|
||||
private int WidthM;
|
||||
private int WidthM;
|
||||
|
||||
private int HeightM;
|
||||
private int HeightM;
|
||||
|
||||
public static double FPS;
|
||||
public static double FPS;
|
||||
|
||||
public FPS FPSF = new FPS(FPS);
|
||||
public FPS FPSF = new FPS(FPS);
|
||||
|
||||
private bool cur = true;
|
||||
private bool cur = true;
|
||||
|
||||
public HashSet<Color> HitColors = new HashSet<Color>
|
||||
{
|
||||
Color.Transparent,
|
||||
Color.Black
|
||||
};
|
||||
public HashSet<Color> HitColors = new HashSet<Color>
|
||||
{
|
||||
Color.Transparent,
|
||||
Color.Black
|
||||
};
|
||||
|
||||
private const int LOGPIXELSX = 88;
|
||||
private const int LOGPIXELSX = 88;
|
||||
|
||||
private const int LOGPIXELSY = 90;
|
||||
private const int LOGPIXELSY = 90;
|
||||
|
||||
public static double dpiX;
|
||||
public static double dpiX;
|
||||
|
||||
public static double dpiY;
|
||||
public static double dpiY;
|
||||
|
||||
public static double DpiX;
|
||||
public static double DpiX;
|
||||
|
||||
public static double DpiY;
|
||||
public static double DpiY;
|
||||
|
||||
public string UITitle;
|
||||
public string UITitle;
|
||||
|
||||
public bool ShowFPS;
|
||||
public bool ShowFPS;
|
||||
|
||||
//public Control BaseControlC => baseControl;
|
||||
//public Control BaseControlC => baseControl;
|
||||
|
||||
public GlImage BaseControl => baseControl;
|
||||
public GlImage BaseControl => baseControl;
|
||||
|
||||
public double ResMag => resMag;
|
||||
public double ResMag => resMag;
|
||||
|
||||
public Vector2D ResVector => resVector;
|
||||
public Vector2D ResVector => resVector;
|
||||
|
||||
public string Mode
|
||||
{
|
||||
get
|
||||
{
|
||||
return mode;
|
||||
}
|
||||
set
|
||||
{
|
||||
Modes[mode].Up(MouseButtons.None, Dat.Vec2DZero, Color.Empty);
|
||||
Modes[mode].Move(MouseButtons.None, Dat.Vec2DZero, Color.Empty);
|
||||
Modeb = mode;
|
||||
mode = value;
|
||||
Modes[mode].Move(MouseButtons.None, Dat.Vec2DZero, Color.Empty);
|
||||
Modes[mode].Setting();
|
||||
}
|
||||
}
|
||||
public string Mode
|
||||
{
|
||||
get
|
||||
{
|
||||
return mode;
|
||||
}
|
||||
set
|
||||
{
|
||||
Modes[mode].Up(MouseButtons.None, Dat.Vec2DZero, Color.Empty);
|
||||
Modes[mode].Move(MouseButtons.None, Dat.Vec2DZero, Color.Empty);
|
||||
Modeb = mode;
|
||||
mode = value;
|
||||
Modes[mode].Move(MouseButtons.None, Dat.Vec2DZero, Color.Empty);
|
||||
Modes[mode].Setting();
|
||||
}
|
||||
}
|
||||
|
||||
public Vector2D CursorPosition => ToBasePosition(baseControl.GetCursorPoint()); //ToBasePosition(baseControl.PointToClient(System.Windows.Forms.Cursor.Position));
|
||||
public Vector2D CursorPosition => ToBasePosition(baseControl.GetCursorPoint()); //ToBasePosition(baseControl.PointToClient(System.Windows.Forms.Cursor.Position));
|
||||
|
||||
public Med()
|
||||
{
|
||||
Point dpi = GetDpi();
|
||||
dpiX = dpi.X;
|
||||
dpiY = dpi.Y;
|
||||
DpiX = 96.0 / dpiX;
|
||||
DpiY = 96.0 / dpiY;
|
||||
}
|
||||
public Med()
|
||||
{
|
||||
Point dpi = GetDpi();
|
||||
dpiX = dpi.X;
|
||||
dpiY = dpi.Y;
|
||||
DpiX = 96.0 / dpiX;
|
||||
DpiY = 96.0 / dpiY;
|
||||
}
|
||||
|
||||
public void FadeIn(double Rate)
|
||||
{
|
||||
Sce.TransformAlpha(GD, Rate);
|
||||
}
|
||||
public void FadeIn(double Rate)
|
||||
{
|
||||
Sce.TransformAlpha(GD, Rate);
|
||||
}
|
||||
|
||||
public void FadeOut(double Rate)
|
||||
{
|
||||
Sce.TransD(GD, Rate);
|
||||
}
|
||||
public void FadeOut(double Rate)
|
||||
{
|
||||
Sce.TransD(GD, Rate);
|
||||
}
|
||||
|
||||
public void DrawStart(Are Are)
|
||||
{
|
||||
Sce.DrawStart(Are);
|
||||
}
|
||||
public void DrawStart(Are Are)
|
||||
{
|
||||
Sce.DrawStart(Are);
|
||||
}
|
||||
|
||||
public void DrawEnd(Are Are)
|
||||
{
|
||||
Sce.DrawEnd(Are);
|
||||
}
|
||||
public void DrawEnd(Are Are)
|
||||
{
|
||||
Sce.DrawEnd(Are);
|
||||
}
|
||||
|
||||
public void ClearSta(Color ClearColor)
|
||||
{
|
||||
Sce.ClearStart(ref ClearColor);
|
||||
}
|
||||
public void ClearSta(Color ClearColor)
|
||||
{
|
||||
Sce.ClearStart(ref ClearColor);
|
||||
}
|
||||
|
||||
public void InitializeModes(string Mode, Func<Med, Dictionary<string, Module>> GetModes)
|
||||
{
|
||||
mode = Mode;
|
||||
this.GetModes = GetModes;
|
||||
}
|
||||
public void InitializeModes(string Mode, Func<Med, Dictionary<string, Module>> GetModes)
|
||||
{
|
||||
mode = Mode;
|
||||
this.GetModes = GetModes;
|
||||
}
|
||||
|
||||
public Size Setting(GlImage BaseControl)
|
||||
{
|
||||
baseControl = BaseControl;
|
||||
BaseSize = new Size((int)(Base.LocalWidth * Unit), (int)(Base.LocalHeight * Unit));
|
||||
BD = new Bitmap(BaseSize.Width, BaseSize.Height);
|
||||
GD = Graphics.FromImage(BD);
|
||||
GD.InterpolationMode = InterpolationMode.HighQualityBilinear;
|
||||
BH = new Bitmap((int)((double)BaseSize.Width * HitAccuracy), (int)((double)BaseSize.Height * HitAccuracy));
|
||||
GH = Graphics.FromImage(BH);
|
||||
GH.InterpolationMode = InterpolationMode.Bilinear;
|
||||
WidthM = BH.Width - 1;
|
||||
HeightM = BH.Height - 1;
|
||||
Clear();
|
||||
Sce = new Sce(BaseSize.Width, BaseSize.Height);
|
||||
Modes = GetModes(this);
|
||||
public Size Setting(GlImage BaseControl)
|
||||
{
|
||||
baseControl = BaseControl;
|
||||
BaseSize = new Size((int)(Base.LocalWidth * Unit), (int)(Base.LocalHeight * Unit));
|
||||
BD = new Bitmap(BaseSize.Width, BaseSize.Height);
|
||||
GD = Graphics.FromImage(BD);
|
||||
GD.InterpolationMode = InterpolationMode.HighQualityBilinear;
|
||||
BH = new Bitmap((int)((double)BaseSize.Width * HitAccuracy), (int)((double)BaseSize.Height * HitAccuracy));
|
||||
GH = Graphics.FromImage(BH);
|
||||
GH.InterpolationMode = InterpolationMode.Bilinear;
|
||||
WidthM = BH.Width - 1;
|
||||
HeightM = BH.Height - 1;
|
||||
Clear();
|
||||
Sce = new Sce(BaseSize.Width, BaseSize.Height);
|
||||
Modes = GetModes(this);
|
||||
|
||||
|
||||
BaseControl.Click = delegate (IntPtr window, GLFW.MouseButton button, InputState state, GLFW.ModifierKeys modifiers)
|
||||
{
|
||||
double x, y;
|
||||
Glfw.GetCursorPosition(GlImage.PtrToWindow(window), out x, out y);
|
||||
Point Position5 = new Point((int)x, (int)y);
|
||||
MouseButtons arg2 = MouseButtons.None;
|
||||
switch (button)
|
||||
BaseControl.Click = delegate (IntPtr window, GLFW.MouseButton button, InputState state, GLFW.ModifierKeys modifiers)
|
||||
{
|
||||
case GLFW.MouseButton.Left:
|
||||
arg2 = MouseButtons.Left;
|
||||
break;
|
||||
case GLFW.MouseButton.Middle:
|
||||
arg2 = MouseButtons.Middle;
|
||||
break;
|
||||
case GLFW.MouseButton.Right:
|
||||
arg2 = MouseButtons.Right;
|
||||
break;
|
||||
case GLFW.MouseButton.Button4:
|
||||
arg2 = MouseButtons.Button4;
|
||||
break;
|
||||
case GLFW.MouseButton.Button5:
|
||||
arg2 = MouseButtons.Button5;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
(state == InputState.Press ? Modes[mode].Down : Modes[mode].Up)(arg2, ToBasePosition(Position5), GetHitColor(ref Position5));
|
||||
};
|
||||
|
||||
BaseControl.Move = delegate (IntPtr window, double x, double y)
|
||||
{
|
||||
Point Position3 = new Point((int)x, (int)y);
|
||||
Modes[mode].Move(BaseControl.GetMouseButtons(), ToBasePosition(Position3), GetHitColor(ref Position3));
|
||||
};
|
||||
|
||||
BaseControl.Leave = delegate (IntPtr window, bool entered)
|
||||
{
|
||||
if (!entered)
|
||||
{
|
||||
double x, y;
|
||||
Glfw.GetCursorPosition(GlImage.PtrToWindow(window), out x, out y);
|
||||
Point Position2 = new Point((int)x, (int)y);
|
||||
Modes[mode].Leave(BaseControl.GetMouseButtons(), ToBasePosition(Position2), GetHitColor(ref Position2));
|
||||
}
|
||||
};
|
||||
|
||||
BaseControl.Scroll = delegate (IntPtr window, double xo, double yo)
|
||||
{
|
||||
double x, y;
|
||||
Glfw.GetCursorPosition(GlImage.PtrToWindow(window), out x, out y);
|
||||
Point Position = new Point((int)x, (int)y);
|
||||
//Note: yo may be inverted
|
||||
Modes[mode].Wheel(BaseControl.GetMouseButtons(), ToBasePosition(Position), (int)yo, GetHitColor(ref Position));
|
||||
};
|
||||
|
||||
BaseControl.Resize = delegate (IntPtr window, int width, int height)
|
||||
{
|
||||
//TODO mess with viewport
|
||||
if (BaseSize.Width >= BaseSize.Height)
|
||||
{
|
||||
double num = (double)BaseSize.Width / (double)BaseSize.Height;
|
||||
if ((double)width / (double)height <= num)
|
||||
double x, y;
|
||||
Glfw.GetCursorPosition(GlImage.PtrToWindow(window), out x, out y);
|
||||
Point Position5 = new Point((int)x, (int)y);
|
||||
MouseButtons arg2 = MouseButtons.None;
|
||||
switch (button)
|
||||
{
|
||||
resMag = (double)BaseSize.Width / (double)width;
|
||||
resVector.X = 0.0;
|
||||
resVector.Y = ((double)height - (double)BaseSize.Height / resMag) * 0.5;
|
||||
case GLFW.MouseButton.Left:
|
||||
arg2 = MouseButtons.Left;
|
||||
break;
|
||||
case GLFW.MouseButton.Middle:
|
||||
arg2 = MouseButtons.Middle;
|
||||
break;
|
||||
case GLFW.MouseButton.Right:
|
||||
arg2 = MouseButtons.Right;
|
||||
break;
|
||||
case GLFW.MouseButton.Button4:
|
||||
arg2 = MouseButtons.Button4;
|
||||
break;
|
||||
case GLFW.MouseButton.Button5:
|
||||
arg2 = MouseButtons.Button5;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
(state == InputState.Press ? Modes[mode].Down : Modes[mode].Up)(arg2, ToBasePosition(Position5), GetHitColor(ref Position5));
|
||||
};
|
||||
|
||||
BaseControl.Move = delegate (IntPtr window, double x, double y)
|
||||
{
|
||||
Point Position3 = new Point((int)x, (int)y);
|
||||
Modes[mode].Move(BaseControl.GetMouseButtons(), ToBasePosition(Position3), GetHitColor(ref Position3));
|
||||
};
|
||||
|
||||
BaseControl.Leave = delegate (IntPtr window, bool entered)
|
||||
{
|
||||
if (!entered)
|
||||
{
|
||||
double x, y;
|
||||
Glfw.GetCursorPosition(GlImage.PtrToWindow(window), out x, out y);
|
||||
Point Position2 = new Point((int)x, (int)y);
|
||||
Modes[mode].Leave(BaseControl.GetMouseButtons(), ToBasePosition(Position2), GetHitColor(ref Position2));
|
||||
}
|
||||
};
|
||||
|
||||
BaseControl.Scroll = delegate (IntPtr window, double xo, double yo)
|
||||
{
|
||||
double x, y;
|
||||
Glfw.GetCursorPosition(GlImage.PtrToWindow(window), out x, out y);
|
||||
Point Position = new Point((int)x, (int)y);
|
||||
//Note: yo may be inverted
|
||||
Modes[mode].Wheel(BaseControl.GetMouseButtons(), ToBasePosition(Position), (int)yo, GetHitColor(ref Position));
|
||||
};
|
||||
|
||||
BaseControl.Resize = delegate (IntPtr window, int width, int height)
|
||||
{
|
||||
//TODO mess with viewport
|
||||
if (BaseSize.Width >= BaseSize.Height)
|
||||
{
|
||||
double num = (double)BaseSize.Width / (double)BaseSize.Height;
|
||||
if ((double)width / (double)height <= num)
|
||||
{
|
||||
resMag = (double)BaseSize.Width / (double)width;
|
||||
resVector.X = 0.0;
|
||||
resVector.Y = ((double)height - (double)BaseSize.Height / resMag) * 0.5;
|
||||
}
|
||||
else
|
||||
{
|
||||
resMag = (double)BaseSize.Height / (double)height;
|
||||
resVector.X = ((double)width - (double)BaseSize.Width / resMag) * 0.5;
|
||||
resVector.Y = 0.0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
resMag = (double)BaseSize.Height / (double)height;
|
||||
resVector.X = ((double)width - (double)BaseSize.Width / resMag) * 0.5;
|
||||
resVector.Y = 0.0;
|
||||
double num2 = (double)BaseSize.Height / (double)BaseSize.Width;
|
||||
if ((double)height / (double)width <= num2)
|
||||
{
|
||||
resMag = (double)BaseSize.Height / (double)height;
|
||||
resVector.X = ((double)width - (double)BaseSize.Width / resMag) * 0.5;
|
||||
resVector.Y = 0.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
resMag = (double)BaseSize.Width / (double)width;
|
||||
resVector.X = 0.0;
|
||||
resVector.Y = ((double)height - (double)BaseSize.Height / resMag) * 0.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
};
|
||||
|
||||
return BaseSize;
|
||||
}
|
||||
|
||||
public Vector2D ToBasePosition(Point Position)
|
||||
{
|
||||
return new Vector2D(((double)Position.X - resVector.X) / Unit * resMag, ((double)Position.Y - resVector.Y) / Unit * resMag);
|
||||
}
|
||||
|
||||
public Point FromBasePosition(Vector2D Position)
|
||||
{
|
||||
return new Point((int)(Position.X / resMag * Unit + resVector.X), (int)(Position.Y / resMag * Unit + resVector.Y));
|
||||
}
|
||||
|
||||
public Color GetHitColor(Point Position)
|
||||
{
|
||||
double num = HitAccuracy * resMag;
|
||||
Point point = ((Position.ToVector2D() - resVector) * num).ToPoint();
|
||||
if (point.X < 0)
|
||||
{
|
||||
point.X = 0;
|
||||
}
|
||||
if (point.Y < 0)
|
||||
{
|
||||
point.Y = 0;
|
||||
}
|
||||
if (point.X > WidthM)
|
||||
{
|
||||
point.X = WidthM;
|
||||
}
|
||||
if (point.Y > HeightM)
|
||||
{
|
||||
point.Y = HeightM;
|
||||
}
|
||||
return BH.GetPixel(point.X, point.Y);
|
||||
}
|
||||
|
||||
public Color GetHitColor(ref Point Position)
|
||||
{
|
||||
double num = HitAccuracy * resMag;
|
||||
Point point = ((Position.ToVector2D() - resVector) * num).ToPoint();
|
||||
if (point.X < 0)
|
||||
{
|
||||
point.X = 0;
|
||||
}
|
||||
if (point.Y < 0)
|
||||
{
|
||||
point.Y = 0;
|
||||
}
|
||||
if (point.X > WidthM)
|
||||
{
|
||||
point.X = WidthM;
|
||||
}
|
||||
if (point.Y > HeightM)
|
||||
{
|
||||
point.Y = HeightM;
|
||||
}
|
||||
return BH.GetPixel(point.X, point.Y);
|
||||
}
|
||||
|
||||
public void Drawing()
|
||||
{
|
||||
baseControl.BitmapSetting(BD);
|
||||
Modes[mode].Setting();
|
||||
double FPS = 0.0;
|
||||
|
||||
|
||||
Action action = delegate
|
||||
{
|
||||
FPS = FPSF.Value;
|
||||
if (FPS > 1.0)
|
||||
{
|
||||
Modes[mode].Draw(FPSF);
|
||||
}
|
||||
baseControl.SetBitmap(BD);
|
||||
};
|
||||
|
||||
|
||||
while (Drive)
|
||||
{
|
||||
FPSF.FPSFixed(action);
|
||||
|
||||
if (ShowFPS)
|
||||
{
|
||||
baseControl.SetTitle(UITitle + " - FPS: " + System.Math.Round(FPSF.Value, 2));
|
||||
}
|
||||
baseControl.PollEvents();
|
||||
}
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
GD.Clear(ClearColor);
|
||||
GH.Clear(ClearColor);
|
||||
}
|
||||
|
||||
public void Draw(Are Are)
|
||||
{
|
||||
Are.Draw(GD, GH);
|
||||
}
|
||||
|
||||
public void CursorHide()
|
||||
{
|
||||
if (cur)
|
||||
{
|
||||
//TODO fix?
|
||||
//System.Windows.Forms.Cursor.Hide();
|
||||
cur = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void CursorShow()
|
||||
{
|
||||
if (!cur)
|
||||
{
|
||||
double num2 = (double)BaseSize.Height / (double)BaseSize.Width;
|
||||
if ((double)height / (double)width <= num2)
|
||||
{
|
||||
resMag = (double)BaseSize.Height / (double)height;
|
||||
resVector.X = ((double)width - (double)BaseSize.Width / resMag) * 0.5;
|
||||
resVector.Y = 0.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
resMag = (double)BaseSize.Width / (double)width;
|
||||
resVector.X = 0.0;
|
||||
resVector.Y = ((double)height - (double)BaseSize.Height / resMag) * 0.5;
|
||||
}
|
||||
}
|
||||
};
|
||||
//TODO fix?
|
||||
//System.Windows.Forms.Cursor.Show();
|
||||
cur = true;
|
||||
}
|
||||
}
|
||||
|
||||
return BaseSize;
|
||||
}
|
||||
public void InvokeL(Action a)
|
||||
{
|
||||
//TODO this look right?
|
||||
a();
|
||||
//baseControl.Invoke(a);
|
||||
}
|
||||
|
||||
public Vector2D ToBasePosition(Point Position)
|
||||
{
|
||||
return new Vector2D(((double)Position.X - resVector.X) / Unit * resMag, ((double)Position.Y - resVector.Y) / Unit * resMag);
|
||||
}
|
||||
public Color GetUniqueColor()
|
||||
{
|
||||
Oth.GetRandomColor(out var ret);
|
||||
while (HitColors.Contains(ret))
|
||||
{
|
||||
Oth.GetRandomColor(out ret);
|
||||
}
|
||||
HitColors.Add(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public Point FromBasePosition(Vector2D Position)
|
||||
{
|
||||
return new Point((int)(Position.X / resMag * Unit + resVector.X), (int)(Position.Y / resMag * Unit + resVector.Y));
|
||||
}
|
||||
public void GetUniqueColor(out Color c)
|
||||
{
|
||||
Oth.GetRandomColor(out c);
|
||||
while (HitColors.Contains(c))
|
||||
{
|
||||
Oth.GetRandomColor(out c);
|
||||
}
|
||||
HitColors.Add(c);
|
||||
}
|
||||
|
||||
public Color GetHitColor(Point Position)
|
||||
{
|
||||
double num = HitAccuracy * resMag;
|
||||
Point point = ((Position.ToVector2D() - resVector) * num).ToPoint();
|
||||
if (point.X < 0)
|
||||
{
|
||||
point.X = 0;
|
||||
}
|
||||
if (point.Y < 0)
|
||||
{
|
||||
point.Y = 0;
|
||||
}
|
||||
if (point.X > WidthM)
|
||||
{
|
||||
point.X = WidthM;
|
||||
}
|
||||
if (point.Y > HeightM)
|
||||
{
|
||||
point.Y = HeightM;
|
||||
}
|
||||
return BH.GetPixel(point.X, point.Y);
|
||||
}
|
||||
public void SetUniqueColor(IEnumerable<Par> ps)
|
||||
{
|
||||
foreach (Par p in ps)
|
||||
{
|
||||
p.HitColor = GetUniqueColor();
|
||||
}
|
||||
}
|
||||
|
||||
public Color GetHitColor(ref Point Position)
|
||||
{
|
||||
double num = HitAccuracy * resMag;
|
||||
Point point = ((Position.ToVector2D() - resVector) * num).ToPoint();
|
||||
if (point.X < 0)
|
||||
{
|
||||
point.X = 0;
|
||||
}
|
||||
if (point.Y < 0)
|
||||
{
|
||||
point.Y = 0;
|
||||
}
|
||||
if (point.X > WidthM)
|
||||
{
|
||||
point.X = WidthM;
|
||||
}
|
||||
if (point.Y > HeightM)
|
||||
{
|
||||
point.Y = HeightM;
|
||||
}
|
||||
return BH.GetPixel(point.X, point.Y);
|
||||
}
|
||||
public void RemUniqueColor(Color Color)
|
||||
{
|
||||
HitColors.Remove(Color);
|
||||
}
|
||||
|
||||
public void Drawing()
|
||||
{
|
||||
baseControl.BitmapSetting(BD);
|
||||
Modes[mode].Setting();
|
||||
double FPS = 0.0;
|
||||
public void RemUniqueColor(IEnumerable<Par> ps)
|
||||
{
|
||||
foreach (Par p in ps)
|
||||
{
|
||||
HitColors.Remove(p.HitColor);
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Drive = false;
|
||||
foreach (Module value in Modes.Values)
|
||||
{
|
||||
value.Dispose();
|
||||
}
|
||||
BD.Dispose();
|
||||
GD.Dispose();
|
||||
BH.Dispose();
|
||||
GH.Dispose();
|
||||
Sce.Dispose();
|
||||
}
|
||||
|
||||
Action action = delegate
|
||||
{
|
||||
FPS = FPSF.Value;
|
||||
if (FPS > 1.0)
|
||||
{
|
||||
Modes[mode].Draw(FPSF);
|
||||
}
|
||||
baseControl.SetBitmap(BD);
|
||||
};
|
||||
[DllImport("user32.dll")]
|
||||
private static extern bool SetProcessDPIAware();
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
private static extern IntPtr GetWindowDC(IntPtr hwnd);
|
||||
|
||||
while (Drive)
|
||||
{
|
||||
FPSF.FPSFixed(action);
|
||||
[DllImport("gdi32.dll")]
|
||||
private static extern int GetDeviceCaps(IntPtr hdc, int index);
|
||||
|
||||
if (ShowFPS)
|
||||
{
|
||||
baseControl.SetTitle(UITitle + " - FPS: " + System.Math.Round(FPSF.Value, 2));
|
||||
}
|
||||
baseControl.PollEvents();
|
||||
}
|
||||
}
|
||||
[DllImport("user32.dll")]
|
||||
private static extern int ReleaseDC(IntPtr hwnd, IntPtr hdc);
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
GD.Clear(ClearColor);
|
||||
GH.Clear(ClearColor);
|
||||
}
|
||||
public static Point GetDpi()
|
||||
{
|
||||
SetProcessDPIAware();
|
||||
IntPtr windowDC = GetWindowDC(IntPtr.Zero);
|
||||
Point result = new Point(GetDeviceCaps(windowDC, 88), GetDeviceCaps(windowDC, 90));
|
||||
ReleaseDC(IntPtr.Zero, windowDC);
|
||||
return result;
|
||||
}
|
||||
|
||||
public void Draw(Are Are)
|
||||
{
|
||||
Are.Draw(GD, GH);
|
||||
}
|
||||
|
||||
public void CursorHide()
|
||||
{
|
||||
if (cur)
|
||||
{
|
||||
//TODO fix?
|
||||
//System.Windows.Forms.Cursor.Hide();
|
||||
cur = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void CursorShow()
|
||||
{
|
||||
if (!cur)
|
||||
{
|
||||
//TODO fix?
|
||||
//System.Windows.Forms.Cursor.Show();
|
||||
cur = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void InvokeL(Action a)
|
||||
{
|
||||
//TODO this look right?
|
||||
a();
|
||||
//baseControl.Invoke(a);
|
||||
}
|
||||
|
||||
public Color GetUniqueColor()
|
||||
{
|
||||
Oth.GetRandomColor(out var ret);
|
||||
while (HitColors.Contains(ret))
|
||||
{
|
||||
Oth.GetRandomColor(out ret);
|
||||
}
|
||||
HitColors.Add(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public void GetUniqueColor(out Color c)
|
||||
{
|
||||
Oth.GetRandomColor(out c);
|
||||
while (HitColors.Contains(c))
|
||||
{
|
||||
Oth.GetRandomColor(out c);
|
||||
}
|
||||
HitColors.Add(c);
|
||||
}
|
||||
|
||||
public void SetUniqueColor(IEnumerable<Par> ps)
|
||||
{
|
||||
foreach (Par p in ps)
|
||||
{
|
||||
p.HitColor = GetUniqueColor();
|
||||
}
|
||||
}
|
||||
|
||||
public void RemUniqueColor(Color Color)
|
||||
{
|
||||
HitColors.Remove(Color);
|
||||
}
|
||||
|
||||
public void RemUniqueColor(IEnumerable<Par> ps)
|
||||
{
|
||||
foreach (Par p in ps)
|
||||
{
|
||||
HitColors.Remove(p.HitColor);
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Drive = false;
|
||||
foreach (Module value in Modes.Values)
|
||||
{
|
||||
value.Dispose();
|
||||
}
|
||||
BD.Dispose();
|
||||
GD.Dispose();
|
||||
BH.Dispose();
|
||||
GH.Dispose();
|
||||
Sce.Dispose();
|
||||
}
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
private static extern bool SetProcessDPIAware();
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
private static extern IntPtr GetWindowDC(IntPtr hwnd);
|
||||
|
||||
[DllImport("gdi32.dll")]
|
||||
private static extern int GetDeviceCaps(IntPtr hdc, int index);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
private static extern int ReleaseDC(IntPtr hwnd, IntPtr hdc);
|
||||
|
||||
public static Point GetDpi()
|
||||
{
|
||||
SetProcessDPIAware();
|
||||
IntPtr windowDC = GetWindowDC(IntPtr.Zero);
|
||||
Point result = new Point(GetDeviceCaps(windowDC, 88), GetDeviceCaps(windowDC, 90));
|
||||
ReleaseDC(IntPtr.Zero, windowDC);
|
||||
return result;
|
||||
}
|
||||
|
||||
static Med()
|
||||
{
|
||||
obj = new object();
|
||||
FPS = 60.0;
|
||||
}
|
||||
static Med()
|
||||
{
|
||||
obj = new object();
|
||||
FPS = 60.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,39 +1,40 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
public class Module
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
public Action<MouseButtons, Vector2D, Color> Down = delegate
|
||||
{
|
||||
};
|
||||
public class Module
|
||||
{
|
||||
public Action<MouseButtons, Vector2D, Color> Down = delegate
|
||||
{
|
||||
};
|
||||
|
||||
public Action<MouseButtons, Vector2D, Color> Up = delegate
|
||||
{
|
||||
};
|
||||
public Action<MouseButtons, Vector2D, Color> Up = delegate
|
||||
{
|
||||
};
|
||||
|
||||
public Action<MouseButtons, Vector2D, Color> Move = delegate
|
||||
{
|
||||
};
|
||||
public Action<MouseButtons, Vector2D, Color> Move = delegate
|
||||
{
|
||||
};
|
||||
|
||||
public Action<MouseButtons, Vector2D, Color> Leave = delegate
|
||||
{
|
||||
};
|
||||
public Action<MouseButtons, Vector2D, Color> Leave = delegate
|
||||
{
|
||||
};
|
||||
|
||||
public Action<MouseButtons, Vector2D, int, Color> Wheel = delegate
|
||||
{
|
||||
};
|
||||
public Action<MouseButtons, Vector2D, int, Color> Wheel = delegate
|
||||
{
|
||||
};
|
||||
|
||||
public Action<FPS> Draw = delegate
|
||||
{
|
||||
};
|
||||
public Action<FPS> Draw = delegate
|
||||
{
|
||||
};
|
||||
|
||||
public Action Dispose = delegate
|
||||
{
|
||||
};
|
||||
public Action Dispose = delegate
|
||||
{
|
||||
};
|
||||
|
||||
public Action Setting = delegate
|
||||
{
|
||||
};
|
||||
public Action Setting = delegate
|
||||
{
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,76 +1,77 @@
|
||||
using System;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
public class Mot : MotV
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
public Action<Mot> Staing;
|
||||
public class Mot : MotV
|
||||
{
|
||||
public Action<Mot> Staing;
|
||||
|
||||
public Action<Mot> Runing;
|
||||
public Action<Mot> Runing;
|
||||
|
||||
public Action<Mot> Reaing;
|
||||
public Action<Mot> Reaing;
|
||||
|
||||
public Action<Mot> Rouing;
|
||||
public Action<Mot> Rouing;
|
||||
|
||||
public Action<Mot> Ending;
|
||||
public Action<Mot> Ending;
|
||||
|
||||
private bool run;
|
||||
private bool run;
|
||||
|
||||
private bool rou;
|
||||
private bool rou;
|
||||
|
||||
public bool Run => run;
|
||||
public bool Run => run;
|
||||
|
||||
public Mot(double Min, double Max)
|
||||
: base(Min, Max)
|
||||
{
|
||||
}
|
||||
public Mot(double Min, double Max)
|
||||
: base(Min, Max)
|
||||
{
|
||||
}
|
||||
|
||||
public new void GetValue(FPS FPS)
|
||||
{
|
||||
if (!run)
|
||||
{
|
||||
return;
|
||||
}
|
||||
base.GetValue(FPS);
|
||||
if (Runing != null)
|
||||
{
|
||||
Runing(this);
|
||||
}
|
||||
if (Value == min)
|
||||
{
|
||||
if (rou && Rouing != null)
|
||||
{
|
||||
Rouing(this);
|
||||
}
|
||||
rou = false;
|
||||
}
|
||||
else if (Value == max)
|
||||
{
|
||||
if (Reaing != null)
|
||||
{
|
||||
Reaing(this);
|
||||
}
|
||||
rou = true;
|
||||
}
|
||||
}
|
||||
public new void GetValue(FPS FPS)
|
||||
{
|
||||
if (!run)
|
||||
{
|
||||
return;
|
||||
}
|
||||
base.GetValue(FPS);
|
||||
if (Runing != null)
|
||||
{
|
||||
Runing(this);
|
||||
}
|
||||
if (Value == min)
|
||||
{
|
||||
if (rou && Rouing != null)
|
||||
{
|
||||
Rouing(this);
|
||||
}
|
||||
rou = false;
|
||||
}
|
||||
else if (Value == max)
|
||||
{
|
||||
if (Reaing != null)
|
||||
{
|
||||
Reaing(this);
|
||||
}
|
||||
rou = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void Start()
|
||||
{
|
||||
if (Staing != null)
|
||||
{
|
||||
Staing(this);
|
||||
}
|
||||
run = true;
|
||||
}
|
||||
public void Start()
|
||||
{
|
||||
if (Staing != null)
|
||||
{
|
||||
Staing(this);
|
||||
}
|
||||
run = true;
|
||||
}
|
||||
|
||||
public void End()
|
||||
{
|
||||
run = false;
|
||||
if (Ending != null)
|
||||
{
|
||||
Ending(this);
|
||||
}
|
||||
ResetValue();
|
||||
rou = false;
|
||||
}
|
||||
public void End()
|
||||
{
|
||||
run = false;
|
||||
if (Ending != null)
|
||||
{
|
||||
Ending(this);
|
||||
}
|
||||
ResetValue();
|
||||
rou = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,108 +1,109 @@
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
public class MotV
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
public double Value;
|
||||
public class MotV
|
||||
{
|
||||
public double Value;
|
||||
|
||||
protected double min = -1.0;
|
||||
protected double min = -1.0;
|
||||
|
||||
protected double max = 1.0;
|
||||
protected double max = 1.0;
|
||||
|
||||
private double Frame;
|
||||
private double Frame;
|
||||
|
||||
private double FrameHalf;
|
||||
private double FrameHalf;
|
||||
|
||||
private double MinFrameHalf;
|
||||
private double MinFrameHalf;
|
||||
|
||||
public double BaseSpeed = 1.0;
|
||||
public double BaseSpeed = 1.0;
|
||||
|
||||
public double GotoSpeed = 1.0;
|
||||
public double GotoSpeed = 1.0;
|
||||
|
||||
public double RetuSpeed = 1.0;
|
||||
public double RetuSpeed = 1.0;
|
||||
|
||||
public double Interval;
|
||||
public double Interval;
|
||||
|
||||
private long st;
|
||||
private long st;
|
||||
|
||||
public double LowestIncrease = 1.0;
|
||||
public double LowestIncrease = 1.0;
|
||||
|
||||
private int s = 1;
|
||||
private int s = 1;
|
||||
|
||||
private double d;
|
||||
private double d;
|
||||
|
||||
private double m;
|
||||
private double m;
|
||||
|
||||
public double Min
|
||||
{
|
||||
get
|
||||
{
|
||||
return min;
|
||||
}
|
||||
set
|
||||
{
|
||||
min = value;
|
||||
SetFrame();
|
||||
}
|
||||
}
|
||||
public double Min
|
||||
{
|
||||
get
|
||||
{
|
||||
return min;
|
||||
}
|
||||
set
|
||||
{
|
||||
min = value;
|
||||
SetFrame();
|
||||
}
|
||||
}
|
||||
|
||||
public double Max
|
||||
{
|
||||
get
|
||||
{
|
||||
return max;
|
||||
}
|
||||
set
|
||||
{
|
||||
max = value;
|
||||
SetFrame();
|
||||
}
|
||||
}
|
||||
public double Max
|
||||
{
|
||||
get
|
||||
{
|
||||
return max;
|
||||
}
|
||||
set
|
||||
{
|
||||
max = value;
|
||||
SetFrame();
|
||||
}
|
||||
}
|
||||
|
||||
public MotV(double Min, double Max)
|
||||
{
|
||||
min = Min;
|
||||
max = Max;
|
||||
SetFrame();
|
||||
ResetValue();
|
||||
}
|
||||
public MotV(double Min, double Max)
|
||||
{
|
||||
min = Min;
|
||||
max = Max;
|
||||
SetFrame();
|
||||
ResetValue();
|
||||
}
|
||||
|
||||
private void SetFrame()
|
||||
{
|
||||
Frame = max - min;
|
||||
FrameHalf = Frame * 0.5;
|
||||
MinFrameHalf = Min + FrameHalf;
|
||||
}
|
||||
private void SetFrame()
|
||||
{
|
||||
Frame = max - min;
|
||||
FrameHalf = Frame * 0.5;
|
||||
MinFrameHalf = Min + FrameHalf;
|
||||
}
|
||||
|
||||
public void ResetValue()
|
||||
{
|
||||
Value = min;
|
||||
}
|
||||
public void ResetValue()
|
||||
{
|
||||
Value = min;
|
||||
}
|
||||
|
||||
private void Count(FPS FPS)
|
||||
{
|
||||
m = Frame / FPS.Value;
|
||||
Value += (m * d + m * LowestIncrease) * BaseSpeed * ((s > 0) ? GotoSpeed : RetuSpeed) * (double)s;
|
||||
}
|
||||
private void Count(FPS FPS)
|
||||
{
|
||||
m = Frame / FPS.Value;
|
||||
Value += (m * d + m * LowestIncrease) * BaseSpeed * ((s > 0) ? GotoSpeed : RetuSpeed) * (double)s;
|
||||
}
|
||||
|
||||
public void GetValue(FPS FPS)
|
||||
{
|
||||
if (!((double)(FPS.sw.ElapsedMilliseconds - st) < Interval) && FPS.Value > 0.0)
|
||||
{
|
||||
d = (MinFrameHalf - Value) / FrameHalf;
|
||||
d *= d.Sign();
|
||||
d = d.Inverse();
|
||||
Count(FPS);
|
||||
if (Value >= max)
|
||||
{
|
||||
Value = max;
|
||||
s = -s;
|
||||
}
|
||||
else if (Value <= min)
|
||||
{
|
||||
Value = min;
|
||||
s = -s;
|
||||
st = FPS.sw.ElapsedMilliseconds;
|
||||
}
|
||||
}
|
||||
}
|
||||
public void GetValue(FPS FPS)
|
||||
{
|
||||
if (!((double)(FPS.sw.ElapsedMilliseconds - st) < Interval) && FPS.Value > 0.0)
|
||||
{
|
||||
d = (MinFrameHalf - Value) / FrameHalf;
|
||||
d *= d.Sign();
|
||||
d = d.Inverse();
|
||||
Count(FPS);
|
||||
if (Value >= max)
|
||||
{
|
||||
Value = max;
|
||||
s = -s;
|
||||
}
|
||||
else if (Value <= min)
|
||||
{
|
||||
Value = min;
|
||||
s = -s;
|
||||
st = FPS.sw.ElapsedMilliseconds;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,43 +1,44 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
public class Mots
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
public Dictionary<string, Mot> ms;
|
||||
public class Mots
|
||||
{
|
||||
public Dictionary<string, Mot> ms;
|
||||
|
||||
public Mot this[string Name]
|
||||
{
|
||||
get
|
||||
{
|
||||
return ms[Name];
|
||||
}
|
||||
set
|
||||
{
|
||||
ms[Name] = value;
|
||||
}
|
||||
}
|
||||
public Mot this[string Name]
|
||||
{
|
||||
get
|
||||
{
|
||||
return ms[Name];
|
||||
}
|
||||
set
|
||||
{
|
||||
ms[Name] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public Mots()
|
||||
{
|
||||
ms = new Dictionary<string, Mot>();
|
||||
}
|
||||
public Mots()
|
||||
{
|
||||
ms = new Dictionary<string, Mot>();
|
||||
}
|
||||
|
||||
public void Add(string Name, Mot Mot)
|
||||
{
|
||||
ms.Add(Name, Mot);
|
||||
}
|
||||
public void Add(string Name, Mot Mot)
|
||||
{
|
||||
ms.Add(Name, Mot);
|
||||
}
|
||||
|
||||
public void Rem(string Name)
|
||||
{
|
||||
ms.Remove(Name);
|
||||
}
|
||||
public void Rem(string Name)
|
||||
{
|
||||
ms.Remove(Name);
|
||||
}
|
||||
|
||||
public void Drive(FPS FPS)
|
||||
{
|
||||
foreach (Mot value in ms.Values)
|
||||
{
|
||||
value.GetValue(FPS);
|
||||
}
|
||||
}
|
||||
public void Drive(FPS FPS)
|
||||
{
|
||||
foreach (Mot value in ms.Values)
|
||||
{
|
||||
value.GetValue(FPS);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,221 +1,222 @@
|
||||
using System;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
public class MyRandom : Random
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
protected uint x;
|
||||
public class MyRandom : Random
|
||||
{
|
||||
protected uint x;
|
||||
|
||||
protected uint y;
|
||||
protected uint y;
|
||||
|
||||
protected uint z;
|
||||
protected uint z;
|
||||
|
||||
protected uint w;
|
||||
protected uint w;
|
||||
|
||||
private const double d_4294967296 = 2.3283064365386963E-10;
|
||||
private const double d_4294967296 = 2.3283064365386963E-10;
|
||||
|
||||
private const double d_9007199254740992 = 1.1102230246251565E-16;
|
||||
private const double d_9007199254740992 = 1.1102230246251565E-16;
|
||||
|
||||
protected uint InitMtSub(uint s, uint i)
|
||||
{
|
||||
return 1812433253 * (s ^ (s >> 30)) + i + 1;
|
||||
}
|
||||
protected uint InitMtSub(uint s, uint i)
|
||||
{
|
||||
return 1812433253 * (s ^ (s >> 30)) + i + 1;
|
||||
}
|
||||
|
||||
public void Initialize(uint s)
|
||||
{
|
||||
x = InitMtSub(s, 0u);
|
||||
y = InitMtSub(x, 1u);
|
||||
z = InitMtSub(y, 2u);
|
||||
w = InitMtSub(z, 3u);
|
||||
}
|
||||
public void Initialize(uint s)
|
||||
{
|
||||
x = InitMtSub(s, 0u);
|
||||
y = InitMtSub(x, 1u);
|
||||
z = InitMtSub(y, 2u);
|
||||
w = InitMtSub(z, 3u);
|
||||
}
|
||||
|
||||
public MyRandom(uint s)
|
||||
{
|
||||
Initialize(s);
|
||||
}
|
||||
public MyRandom(uint s)
|
||||
{
|
||||
Initialize(s);
|
||||
}
|
||||
|
||||
public MyRandom()
|
||||
: this(4357u)
|
||||
{
|
||||
}
|
||||
public MyRandom()
|
||||
: this(4357u)
|
||||
{
|
||||
}
|
||||
|
||||
public void Initialize(uint[] key)
|
||||
{
|
||||
uint num = (uint)key.Length;
|
||||
uint[] array = new uint[4];
|
||||
Initialize(1u);
|
||||
array[0] = x;
|
||||
array[1] = y;
|
||||
array[2] = z;
|
||||
array[3] = w;
|
||||
uint s = w;
|
||||
uint num2;
|
||||
for (num2 = 0u; num2 < num; num2++)
|
||||
{
|
||||
array[num2 & 3] ^= (s = InitMtSub(s, key[num2] + num2));
|
||||
}
|
||||
uint num3 = 0u;
|
||||
while (num3 < 3)
|
||||
{
|
||||
array[num2 & 3] ^= (s = InitMtSub(s, num3));
|
||||
num3++;
|
||||
num2++;
|
||||
}
|
||||
x = array[0];
|
||||
y = array[1];
|
||||
z = array[2];
|
||||
w = array[3];
|
||||
if (x == 0 && y == 0 && z == 0 && w == 0)
|
||||
{
|
||||
x = 1u;
|
||||
}
|
||||
}
|
||||
public void Initialize(uint[] key)
|
||||
{
|
||||
uint num = (uint)key.Length;
|
||||
uint[] array = new uint[4];
|
||||
Initialize(1u);
|
||||
array[0] = x;
|
||||
array[1] = y;
|
||||
array[2] = z;
|
||||
array[3] = w;
|
||||
uint s = w;
|
||||
uint num2;
|
||||
for (num2 = 0u; num2 < num; num2++)
|
||||
{
|
||||
array[num2 & 3] ^= (s = InitMtSub(s, key[num2] + num2));
|
||||
}
|
||||
uint num3 = 0u;
|
||||
while (num3 < 3)
|
||||
{
|
||||
array[num2 & 3] ^= (s = InitMtSub(s, num3));
|
||||
num3++;
|
||||
num2++;
|
||||
}
|
||||
x = array[0];
|
||||
y = array[1];
|
||||
z = array[2];
|
||||
w = array[3];
|
||||
if (x == 0 && y == 0 && z == 0 && w == 0)
|
||||
{
|
||||
x = 1u;
|
||||
}
|
||||
}
|
||||
|
||||
public MyRandom(uint[] key)
|
||||
{
|
||||
Initialize(key);
|
||||
}
|
||||
public MyRandom(uint[] key)
|
||||
{
|
||||
Initialize(key);
|
||||
}
|
||||
|
||||
public override int Next()
|
||||
{
|
||||
uint num = x ^ (x << 11);
|
||||
x = y;
|
||||
y = z;
|
||||
z = w;
|
||||
return (int)(0.5 * (double)(w = w ^ (w >> 19) ^ num ^ (num >> 8)));
|
||||
}
|
||||
public override int Next()
|
||||
{
|
||||
uint num = x ^ (x << 11);
|
||||
x = y;
|
||||
y = z;
|
||||
z = w;
|
||||
return (int)(0.5 * (double)(w = w ^ (w >> 19) ^ num ^ (num >> 8)));
|
||||
}
|
||||
|
||||
public override int Next(int les)
|
||||
{
|
||||
uint num = x ^ (x << 11);
|
||||
x = y;
|
||||
y = z;
|
||||
z = w;
|
||||
return (int)((double)les * 2.3283064365386963E-10 * (double)(w = w ^ (w >> 19) ^ num ^ (num >> 8)));
|
||||
}
|
||||
public override int Next(int les)
|
||||
{
|
||||
uint num = x ^ (x << 11);
|
||||
x = y;
|
||||
y = z;
|
||||
z = w;
|
||||
return (int)((double)les * 2.3283064365386963E-10 * (double)(w = w ^ (w >> 19) ^ num ^ (num >> 8)));
|
||||
}
|
||||
|
||||
public void Next(int les, out int o)
|
||||
{
|
||||
uint num = x ^ (x << 11);
|
||||
x = y;
|
||||
y = z;
|
||||
z = w;
|
||||
o = (int)((double)les * 2.3283064365386963E-10 * (double)(w = w ^ (w >> 19) ^ num ^ (num >> 8)));
|
||||
}
|
||||
public void Next(int les, out int o)
|
||||
{
|
||||
uint num = x ^ (x << 11);
|
||||
x = y;
|
||||
y = z;
|
||||
z = w;
|
||||
o = (int)((double)les * 2.3283064365386963E-10 * (double)(w = w ^ (w >> 19) ^ num ^ (num >> 8)));
|
||||
}
|
||||
|
||||
public override int Next(int sta, int les)
|
||||
{
|
||||
uint num = x ^ (x << 11);
|
||||
x = y;
|
||||
y = z;
|
||||
z = w;
|
||||
return (int)((double)(les - sta) * 2.3283064365386963E-10 * (double)(w = w ^ (w >> 19) ^ num ^ (num >> 8))) + sta;
|
||||
}
|
||||
public override int Next(int sta, int les)
|
||||
{
|
||||
uint num = x ^ (x << 11);
|
||||
x = y;
|
||||
y = z;
|
||||
z = w;
|
||||
return (int)((double)(les - sta) * 2.3283064365386963E-10 * (double)(w = w ^ (w >> 19) ^ num ^ (num >> 8))) + sta;
|
||||
}
|
||||
|
||||
public int NextM(int max)
|
||||
{
|
||||
uint num = x ^ (x << 11);
|
||||
x = y;
|
||||
y = z;
|
||||
z = w;
|
||||
return (int)((double)((long)max + 1L) * 2.3283064365386963E-10 * (double)(w = w ^ (w >> 19) ^ num ^ (num >> 8)));
|
||||
}
|
||||
public int NextM(int max)
|
||||
{
|
||||
uint num = x ^ (x << 11);
|
||||
x = y;
|
||||
y = z;
|
||||
z = w;
|
||||
return (int)((double)((long)max + 1L) * 2.3283064365386963E-10 * (double)(w = w ^ (w >> 19) ^ num ^ (num >> 8)));
|
||||
}
|
||||
|
||||
public int NextM(int min, int max)
|
||||
{
|
||||
uint num = x ^ (x << 11);
|
||||
x = y;
|
||||
y = z;
|
||||
z = w;
|
||||
return (int)((double)((long)(max - min) + 1L) * 2.3283064365386963E-10 * (double)(w = w ^ (w >> 19) ^ num ^ (num >> 8))) + min;
|
||||
}
|
||||
public int NextM(int min, int max)
|
||||
{
|
||||
uint num = x ^ (x << 11);
|
||||
x = y;
|
||||
y = z;
|
||||
z = w;
|
||||
return (int)((double)((long)(max - min) + 1L) * 2.3283064365386963E-10 * (double)(w = w ^ (w >> 19) ^ num ^ (num >> 8))) + min;
|
||||
}
|
||||
|
||||
public override double NextDouble()
|
||||
{
|
||||
uint num = x ^ (x << 11);
|
||||
x = y;
|
||||
y = z;
|
||||
z = w;
|
||||
uint num2 = (w = w ^ (w >> 19) ^ num ^ (num >> 8)) >> 11;
|
||||
num = x ^ (x << 11);
|
||||
x = y;
|
||||
y = z;
|
||||
z = w;
|
||||
return 1.1102230246251565E-16 * ((double)(w = w ^ (w >> 19) ^ num ^ (num >> 8)) * 2097152.0 + (double)num2);
|
||||
}
|
||||
public override double NextDouble()
|
||||
{
|
||||
uint num = x ^ (x << 11);
|
||||
x = y;
|
||||
y = z;
|
||||
z = w;
|
||||
uint num2 = (w = w ^ (w >> 19) ^ num ^ (num >> 8)) >> 11;
|
||||
num = x ^ (x << 11);
|
||||
x = y;
|
||||
y = z;
|
||||
z = w;
|
||||
return 1.1102230246251565E-16 * ((double)(w = w ^ (w >> 19) ^ num ^ (num >> 8)) * 2097152.0 + (double)num2);
|
||||
}
|
||||
|
||||
public double NextDouble(double les)
|
||||
{
|
||||
uint num = x ^ (x << 11);
|
||||
x = y;
|
||||
y = z;
|
||||
z = w;
|
||||
uint num2 = (w = w ^ (w >> 19) ^ num ^ (num >> 8)) >> 11;
|
||||
num = x ^ (x << 11);
|
||||
x = y;
|
||||
y = z;
|
||||
z = w;
|
||||
return les * 1.1102230246251565E-16 * ((double)(w = w ^ (w >> 19) ^ num ^ (num >> 8)) * 2097152.0 + (double)num2);
|
||||
}
|
||||
public double NextDouble(double les)
|
||||
{
|
||||
uint num = x ^ (x << 11);
|
||||
x = y;
|
||||
y = z;
|
||||
z = w;
|
||||
uint num2 = (w = w ^ (w >> 19) ^ num ^ (num >> 8)) >> 11;
|
||||
num = x ^ (x << 11);
|
||||
x = y;
|
||||
y = z;
|
||||
z = w;
|
||||
return les * 1.1102230246251565E-16 * ((double)(w = w ^ (w >> 19) ^ num ^ (num >> 8)) * 2097152.0 + (double)num2);
|
||||
}
|
||||
|
||||
public double NextDouble(double sta, double les)
|
||||
{
|
||||
uint num = x ^ (x << 11);
|
||||
x = y;
|
||||
y = z;
|
||||
z = w;
|
||||
uint num2 = (w = w ^ (w >> 19) ^ num ^ (num >> 8)) >> 11;
|
||||
num = x ^ (x << 11);
|
||||
x = y;
|
||||
y = z;
|
||||
z = w;
|
||||
return (les - sta) * 1.1102230246251565E-16 * ((double)(w = w ^ (w >> 19) ^ num ^ (num >> 8)) * 2097152.0 + (double)num2) + sta;
|
||||
}
|
||||
public double NextDouble(double sta, double les)
|
||||
{
|
||||
uint num = x ^ (x << 11);
|
||||
x = y;
|
||||
y = z;
|
||||
z = w;
|
||||
uint num2 = (w = w ^ (w >> 19) ^ num ^ (num >> 8)) >> 11;
|
||||
num = x ^ (x << 11);
|
||||
x = y;
|
||||
y = z;
|
||||
z = w;
|
||||
return (les - sta) * 1.1102230246251565E-16 * ((double)(w = w ^ (w >> 19) ^ num ^ (num >> 8)) * 2097152.0 + (double)num2) + sta;
|
||||
}
|
||||
|
||||
public bool NextBool()
|
||||
{
|
||||
uint num = x ^ (x << 11);
|
||||
x = y;
|
||||
y = z;
|
||||
z = w;
|
||||
return (w = w ^ (w >> 19) ^ num ^ (num >> 8)) % 2 == 0;
|
||||
}
|
||||
public bool NextBool()
|
||||
{
|
||||
uint num = x ^ (x << 11);
|
||||
x = y;
|
||||
y = z;
|
||||
z = w;
|
||||
return (w = w ^ (w >> 19) ^ num ^ (num >> 8)) % 2 == 0;
|
||||
}
|
||||
|
||||
public int NextSign()
|
||||
{
|
||||
uint num = x ^ (x << 11);
|
||||
x = y;
|
||||
y = z;
|
||||
z = w;
|
||||
if ((w = w ^ (w >> 19) ^ num ^ (num >> 8)) % 2 != 0)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
public int NextSign()
|
||||
{
|
||||
uint num = x ^ (x << 11);
|
||||
x = y;
|
||||
y = z;
|
||||
z = w;
|
||||
if ((w = w ^ (w >> 19) ^ num ^ (num >> 8)) % 2 != 0)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
public double NextNorCos(double mu = 0.0, double sigma = 1.0)
|
||||
{
|
||||
uint num = x ^ (x << 11);
|
||||
x = y;
|
||||
y = z;
|
||||
z = w;
|
||||
uint num2 = (w = w ^ (w >> 19) ^ num ^ (num >> 8)) >> 11;
|
||||
num = x ^ (x << 11);
|
||||
x = y;
|
||||
y = z;
|
||||
z = w;
|
||||
double d = 1.1102230246251565E-16 * ((double)(w = w ^ (w >> 19) ^ num ^ (num >> 8)) * 2097152.0 + (double)num2);
|
||||
num = x ^ (x << 11);
|
||||
x = y;
|
||||
y = z;
|
||||
z = w;
|
||||
num2 = (w = w ^ (w >> 19) ^ num ^ (num >> 8)) >> 11;
|
||||
num = x ^ (x << 11);
|
||||
x = y;
|
||||
y = z;
|
||||
z = w;
|
||||
double num3 = 1.1102230246251565E-16 * ((double)(w = w ^ (w >> 19) ^ num ^ (num >> 8)) * 2097152.0 + (double)num2);
|
||||
return System.Math.Sqrt(-2.0 * System.Math.Log(d)) * System.Math.Cos(System.Math.PI * 2.0 * num3) * sigma + mu;
|
||||
}
|
||||
public double NextNorCos(double mu = 0.0, double sigma = 1.0)
|
||||
{
|
||||
uint num = x ^ (x << 11);
|
||||
x = y;
|
||||
y = z;
|
||||
z = w;
|
||||
uint num2 = (w = w ^ (w >> 19) ^ num ^ (num >> 8)) >> 11;
|
||||
num = x ^ (x << 11);
|
||||
x = y;
|
||||
y = z;
|
||||
z = w;
|
||||
double d = 1.1102230246251565E-16 * ((double)(w = w ^ (w >> 19) ^ num ^ (num >> 8)) * 2097152.0 + (double)num2);
|
||||
num = x ^ (x << 11);
|
||||
x = y;
|
||||
y = z;
|
||||
z = w;
|
||||
num2 = (w = w ^ (w >> 19) ^ num ^ (num >> 8)) >> 11;
|
||||
num = x ^ (x << 11);
|
||||
x = y;
|
||||
y = z;
|
||||
z = w;
|
||||
double num3 = 1.1102230246251565E-16 * ((double)(w = w ^ (w >> 19) ^ num ^ (num >> 8)) * 2097152.0 + (double)num2);
|
||||
return System.Math.Sqrt(-2.0 * System.Math.Log(d)) * System.Math.Cos(System.Math.PI * 2.0 * num3) * sigma + mu;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,205 +2,206 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
[Serializable]
|
||||
public class OrderedDictionary<T1, T2>
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
private List<T1> keys;
|
||||
[Serializable]
|
||||
public class OrderedDictionary<T1, T2>
|
||||
{
|
||||
private List<T1> keys;
|
||||
|
||||
private Dictionary<T1, T2> values;
|
||||
private Dictionary<T1, T2> values;
|
||||
|
||||
public T2 this[T1 Key]
|
||||
{
|
||||
get
|
||||
{
|
||||
return values[Key];
|
||||
}
|
||||
set
|
||||
{
|
||||
values[Key] = value;
|
||||
}
|
||||
}
|
||||
public T2 this[T1 Key]
|
||||
{
|
||||
get
|
||||
{
|
||||
return values[Key];
|
||||
}
|
||||
set
|
||||
{
|
||||
values[Key] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public T2 this[int Index]
|
||||
{
|
||||
get
|
||||
{
|
||||
return values[keys[Index]];
|
||||
}
|
||||
set
|
||||
{
|
||||
values[keys[Index]] = value;
|
||||
}
|
||||
}
|
||||
public T2 this[int Index]
|
||||
{
|
||||
get
|
||||
{
|
||||
return values[keys[Index]];
|
||||
}
|
||||
set
|
||||
{
|
||||
values[keys[Index]] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<T1> Keys => keys;
|
||||
public IEnumerable<T1> Keys => keys;
|
||||
|
||||
public IEnumerable<T2> Values
|
||||
{
|
||||
get
|
||||
{
|
||||
foreach (T1 key in keys)
|
||||
{
|
||||
yield return values[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
public IEnumerable<T2> Values
|
||||
{
|
||||
get
|
||||
{
|
||||
foreach (T1 key in keys)
|
||||
{
|
||||
yield return values[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int Count => keys.Count;
|
||||
public int Count => keys.Count;
|
||||
|
||||
public OrderedDictionary()
|
||||
{
|
||||
keys = new List<T1>();
|
||||
values = new Dictionary<T1, T2>();
|
||||
}
|
||||
public OrderedDictionary()
|
||||
{
|
||||
keys = new List<T1>();
|
||||
values = new Dictionary<T1, T2>();
|
||||
}
|
||||
|
||||
public OrderedDictionary(int capacity)
|
||||
{
|
||||
keys = new List<T1>(capacity);
|
||||
values = new Dictionary<T1, T2>(capacity);
|
||||
}
|
||||
public OrderedDictionary(int capacity)
|
||||
{
|
||||
keys = new List<T1>(capacity);
|
||||
values = new Dictionary<T1, T2>(capacity);
|
||||
}
|
||||
|
||||
public int IndexOf(T1 Key)
|
||||
{
|
||||
return keys.IndexOf(Key);
|
||||
}
|
||||
public int IndexOf(T1 Key)
|
||||
{
|
||||
return keys.IndexOf(Key);
|
||||
}
|
||||
|
||||
public int IndexOf(ref T1 Key)
|
||||
{
|
||||
return keys.IndexOf(Key);
|
||||
}
|
||||
public int IndexOf(ref T1 Key)
|
||||
{
|
||||
return keys.IndexOf(Key);
|
||||
}
|
||||
|
||||
public int IndexOf(T2 Value)
|
||||
{
|
||||
int num = 0;
|
||||
foreach (T2 value in Values)
|
||||
{
|
||||
if (value.Equals(Value))
|
||||
{
|
||||
return num;
|
||||
}
|
||||
num++;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
public int IndexOf(T2 Value)
|
||||
{
|
||||
int num = 0;
|
||||
foreach (T2 value in Values)
|
||||
{
|
||||
if (value.Equals(Value))
|
||||
{
|
||||
return num;
|
||||
}
|
||||
num++;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public int IndexOf(ref T2 Value)
|
||||
{
|
||||
int num = 0;
|
||||
foreach (T2 value in Values)
|
||||
{
|
||||
if (value.Equals(Value))
|
||||
{
|
||||
return num;
|
||||
}
|
||||
num++;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
public int IndexOf(ref T2 Value)
|
||||
{
|
||||
int num = 0;
|
||||
foreach (T2 value in Values)
|
||||
{
|
||||
if (value.Equals(Value))
|
||||
{
|
||||
return num;
|
||||
}
|
||||
num++;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public int LastIndexOf(T1 Key)
|
||||
{
|
||||
return keys.LastIndexOf(Key);
|
||||
}
|
||||
public int LastIndexOf(T1 Key)
|
||||
{
|
||||
return keys.LastIndexOf(Key);
|
||||
}
|
||||
|
||||
public int LastIndexOf(ref T1 Key)
|
||||
{
|
||||
return keys.LastIndexOf(Key);
|
||||
}
|
||||
public int LastIndexOf(ref T1 Key)
|
||||
{
|
||||
return keys.LastIndexOf(Key);
|
||||
}
|
||||
|
||||
public int LastIndexOf(T2 Value)
|
||||
{
|
||||
int num = keys.Count - 1;
|
||||
foreach (T2 item in Values.Reverse())
|
||||
{
|
||||
if (item.Equals(Value))
|
||||
{
|
||||
return num;
|
||||
}
|
||||
num--;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
public int LastIndexOf(T2 Value)
|
||||
{
|
||||
int num = keys.Count - 1;
|
||||
foreach (T2 item in Values.Reverse())
|
||||
{
|
||||
if (item.Equals(Value))
|
||||
{
|
||||
return num;
|
||||
}
|
||||
num--;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public int LastIndexOf(ref T2 Value)
|
||||
{
|
||||
int num = keys.Count - 1;
|
||||
foreach (T2 item in Values.Reverse())
|
||||
{
|
||||
if (item.Equals(Value))
|
||||
{
|
||||
return num;
|
||||
}
|
||||
num--;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
public int LastIndexOf(ref T2 Value)
|
||||
{
|
||||
int num = keys.Count - 1;
|
||||
foreach (T2 item in Values.Reverse())
|
||||
{
|
||||
if (item.Equals(Value))
|
||||
{
|
||||
return num;
|
||||
}
|
||||
num--;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public void Add(T1 Key, T2 Value)
|
||||
{
|
||||
keys.Add(Key);
|
||||
values.Add(Key, Value);
|
||||
}
|
||||
public void Add(T1 Key, T2 Value)
|
||||
{
|
||||
keys.Add(Key);
|
||||
values.Add(Key, Value);
|
||||
}
|
||||
|
||||
public void Add(ref T1 Key, ref T2 Value)
|
||||
{
|
||||
keys.Add(Key);
|
||||
values.Add(Key, Value);
|
||||
}
|
||||
public void Add(ref T1 Key, ref T2 Value)
|
||||
{
|
||||
keys.Add(Key);
|
||||
values.Add(Key, Value);
|
||||
}
|
||||
|
||||
public void Insert(int Index, T1 Key, T2 Value)
|
||||
{
|
||||
keys.Insert(Index, Key);
|
||||
values.Add(Key, Value);
|
||||
}
|
||||
public void Insert(int Index, T1 Key, T2 Value)
|
||||
{
|
||||
keys.Insert(Index, Key);
|
||||
values.Add(Key, Value);
|
||||
}
|
||||
|
||||
public void Insert(int Index, ref T1 Key, ref T2 Value)
|
||||
{
|
||||
keys.Insert(Index, Key);
|
||||
values.Add(Key, Value);
|
||||
}
|
||||
public void Insert(int Index, ref T1 Key, ref T2 Value)
|
||||
{
|
||||
keys.Insert(Index, Key);
|
||||
values.Add(Key, Value);
|
||||
}
|
||||
|
||||
public void Remove(T1 Key)
|
||||
{
|
||||
keys.Remove(Key);
|
||||
values.Remove(Key);
|
||||
}
|
||||
public void Remove(T1 Key)
|
||||
{
|
||||
keys.Remove(Key);
|
||||
values.Remove(Key);
|
||||
}
|
||||
|
||||
public void Remove(ref T1 Key)
|
||||
{
|
||||
keys.Remove(Key);
|
||||
values.Remove(Key);
|
||||
}
|
||||
public void Remove(ref T1 Key)
|
||||
{
|
||||
keys.Remove(Key);
|
||||
values.Remove(Key);
|
||||
}
|
||||
|
||||
public void Reverse()
|
||||
{
|
||||
keys.Reverse();
|
||||
}
|
||||
public void Reverse()
|
||||
{
|
||||
keys.Reverse();
|
||||
}
|
||||
|
||||
public void Reverse(int Index, int Count)
|
||||
{
|
||||
keys.Reverse(Index, Count);
|
||||
}
|
||||
public void Reverse(int Index, int Count)
|
||||
{
|
||||
keys.Reverse(Index, Count);
|
||||
}
|
||||
|
||||
public bool ContainsKey(T1 Key)
|
||||
{
|
||||
return values.ContainsKey(Key);
|
||||
}
|
||||
public bool ContainsKey(T1 Key)
|
||||
{
|
||||
return values.ContainsKey(Key);
|
||||
}
|
||||
|
||||
public bool ContainsKey(ref T1 Key)
|
||||
{
|
||||
return values.ContainsKey(Key);
|
||||
}
|
||||
public bool ContainsKey(ref T1 Key)
|
||||
{
|
||||
return values.ContainsKey(Key);
|
||||
}
|
||||
|
||||
public bool ContainsValue(T2 Value)
|
||||
{
|
||||
return values.ContainsValue(Value);
|
||||
}
|
||||
public bool ContainsValue(T2 Value)
|
||||
{
|
||||
return values.ContainsValue(Value);
|
||||
}
|
||||
|
||||
public bool ContainsValue(ref T2 Value)
|
||||
{
|
||||
return values.ContainsValue(Value);
|
||||
}
|
||||
public bool ContainsValue(ref T2 Value)
|
||||
{
|
||||
return values.ContainsValue(Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,360 +5,361 @@ using System.Drawing.Drawing2D;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
public static class Oth
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
private static double s1;
|
||||
public static class Oth
|
||||
{
|
||||
private static double s1;
|
||||
|
||||
private static double s0;
|
||||
private static double s0;
|
||||
|
||||
public static double GetDiagonalLength(this double Width, double Height)
|
||||
{
|
||||
return System.Math.Sqrt(Width * Width + Height * Height);
|
||||
}
|
||||
public static double GetDiagonalLength(this double Width, double Height)
|
||||
{
|
||||
return System.Math.Sqrt(Width * Width + Height * Height);
|
||||
}
|
||||
|
||||
public static Color Reverse(this Color c)
|
||||
{
|
||||
return Color.FromArgb(c.A, 255 - c.R, 255 - c.G, 255 - c.B);
|
||||
}
|
||||
public static Color Reverse(this Color c)
|
||||
{
|
||||
return Color.FromArgb(c.A, 255 - c.R, 255 - c.G, 255 - c.B);
|
||||
}
|
||||
|
||||
public static void GetRandomColor(out Color ret)
|
||||
{
|
||||
ret = Color.FromArgb(255, RNG.XS.Next(256), RNG.XS.Next(256), RNG.XS.Next(256));
|
||||
}
|
||||
public static void GetRandomColor(out Color ret)
|
||||
{
|
||||
ret = Color.FromArgb(255, RNG.XS.Next(256), RNG.XS.Next(256), RNG.XS.Next(256));
|
||||
}
|
||||
|
||||
public static Color GetInter(ref Color c1, ref Color c2)
|
||||
{
|
||||
return Color.FromArgb((c1.A + c2.A) / 2, (c1.R + c2.R) / 2, (c1.G + c2.G) / 2, (c1.B + c2.B) / 2);
|
||||
}
|
||||
public static Color GetInter(ref Color c1, ref Color c2)
|
||||
{
|
||||
return Color.FromArgb((c1.A + c2.A) / 2, (c1.R + c2.R) / 2, (c1.G + c2.G) / 2, (c1.B + c2.B) / 2);
|
||||
}
|
||||
|
||||
public static void GetInter(ref Color c1, ref Color c2, out Color ret)
|
||||
{
|
||||
ret = Color.FromArgb((c1.A + c2.A) / 2, (c1.R + c2.R) / 2, (c1.G + c2.G) / 2, (c1.B + c2.B) / 2);
|
||||
}
|
||||
public static void GetInter(ref Color c1, ref Color c2, out Color ret)
|
||||
{
|
||||
ret = Color.FromArgb((c1.A + c2.A) / 2, (c1.R + c2.R) / 2, (c1.G + c2.G) / 2, (c1.B + c2.B) / 2);
|
||||
}
|
||||
|
||||
public static Vector2D GetRandomVector()
|
||||
{
|
||||
return new Vector2D(RNG.XS.NextDouble() * (double)(RNG.XS.NextBool() ? 1 : (-1)), RNG.XS.NextDouble() * (double)(RNG.XS.NextBool() ? 1 : (-1)));
|
||||
}
|
||||
public static Vector2D GetRandomVector()
|
||||
{
|
||||
return new Vector2D(RNG.XS.NextDouble() * (double)(RNG.XS.NextBool() ? 1 : (-1)), RNG.XS.NextDouble() * (double)(RNG.XS.NextBool() ? 1 : (-1)));
|
||||
}
|
||||
|
||||
public static Color FuncHSV(this Color Color, Func<Hsv, Hsv> Func)
|
||||
{
|
||||
return Func(new Hsv(ref Color)).GetColor();
|
||||
}
|
||||
public static Color FuncHSV(this Color Color, Func<Hsv, Hsv> Func)
|
||||
{
|
||||
return Func(new Hsv(ref Color)).GetColor();
|
||||
}
|
||||
|
||||
public static Rectangle GetRect(this Bitmap Bmp)
|
||||
{
|
||||
return new Rectangle(0, 0, Bmp.Width, Bmp.Height);
|
||||
}
|
||||
public static Rectangle GetRect(this Bitmap Bmp)
|
||||
{
|
||||
return new Rectangle(0, 0, Bmp.Width, Bmp.Height);
|
||||
}
|
||||
|
||||
public static LinearGradientBrush GetLGB(double Unit, Vector2D[] MM, Color Color1, Color Color2)
|
||||
{
|
||||
return new LinearGradientBrush((MM[0] * Unit * s0).ToPointF(), (MM[1] * Unit * s1).ToPointF(), Color1, Color2)
|
||||
{
|
||||
GammaCorrection = true
|
||||
};
|
||||
}
|
||||
public static LinearGradientBrush GetLGB(double Unit, Vector2D[] MM, Color Color1, Color Color2)
|
||||
{
|
||||
return new LinearGradientBrush((MM[0] * Unit * s0).ToPointF(), (MM[1] * Unit * s1).ToPointF(), Color1, Color2)
|
||||
{
|
||||
GammaCorrection = true
|
||||
};
|
||||
}
|
||||
|
||||
public static LinearGradientBrush GetLGB(double Unit, Vector2D[] MM, ref Color Color1, ref Color Color2)
|
||||
{
|
||||
return new LinearGradientBrush((MM[0] * Unit * s0).ToPointF(), (MM[1] * Unit * s1).ToPointF(), Color1, Color2)
|
||||
{
|
||||
GammaCorrection = true
|
||||
};
|
||||
}
|
||||
public static LinearGradientBrush GetLGB(double Unit, Vector2D[] MM, ref Color Color1, ref Color Color2)
|
||||
{
|
||||
return new LinearGradientBrush((MM[0] * Unit * s0).ToPointF(), (MM[1] * Unit * s1).ToPointF(), Color1, Color2)
|
||||
{
|
||||
GammaCorrection = true
|
||||
};
|
||||
}
|
||||
|
||||
private static void GetMinMaxX(Par Par, ref double MinX, ref double MaxX)
|
||||
{
|
||||
foreach (Out item in Par.OP)
|
||||
{
|
||||
foreach (Vector2D p in item.ps)
|
||||
{
|
||||
Vector2D vector2D = Par.ToGlobal(p);
|
||||
if (MinX > vector2D.X)
|
||||
{
|
||||
MinX = vector2D.X;
|
||||
}
|
||||
else if (MaxX < vector2D.X)
|
||||
{
|
||||
MaxX = vector2D.X;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
private static void GetMinMaxX(Par Par, ref double MinX, ref double MaxX)
|
||||
{
|
||||
foreach (Out item in Par.OP)
|
||||
{
|
||||
foreach (Vector2D p in item.ps)
|
||||
{
|
||||
Vector2D vector2D = Par.ToGlobal(p);
|
||||
if (MinX > vector2D.X)
|
||||
{
|
||||
MinX = vector2D.X;
|
||||
}
|
||||
else if (MaxX < vector2D.X)
|
||||
{
|
||||
MaxX = vector2D.X;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void GetMinMaxY(Par Par, ref double MinY, ref double MaxY)
|
||||
{
|
||||
foreach (Out item in Par.OP)
|
||||
{
|
||||
foreach (Vector2D p in item.ps)
|
||||
{
|
||||
Vector2D vector2D = Par.ToGlobal(p);
|
||||
if (MinY > vector2D.Y)
|
||||
{
|
||||
MinY = vector2D.Y;
|
||||
}
|
||||
else if (MaxY < vector2D.Y)
|
||||
{
|
||||
MaxY = vector2D.Y;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
private static void GetMinMaxY(Par Par, ref double MinY, ref double MaxY)
|
||||
{
|
||||
foreach (Out item in Par.OP)
|
||||
{
|
||||
foreach (Vector2D p in item.ps)
|
||||
{
|
||||
Vector2D vector2D = Par.ToGlobal(p);
|
||||
if (MinY > vector2D.Y)
|
||||
{
|
||||
MinY = vector2D.Y;
|
||||
}
|
||||
else if (MaxY < vector2D.Y)
|
||||
{
|
||||
MaxY = vector2D.Y;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void GetMinMaxY(Par[] Pars, ref double MinY, ref double MaxY)
|
||||
{
|
||||
for (int i = 0; i < Pars.Length; i++)
|
||||
{
|
||||
GetMinMaxY(Pars[i], ref MinY, ref MaxY);
|
||||
}
|
||||
}
|
||||
private static void GetMinMaxY(Par[] Pars, ref double MinY, ref double MaxY)
|
||||
{
|
||||
for (int i = 0; i < Pars.Length; i++)
|
||||
{
|
||||
GetMinMaxY(Pars[i], ref MinY, ref MaxY);
|
||||
}
|
||||
}
|
||||
|
||||
public static void GetMiX_MaX(this Par Par, out Vector2D[] MM)
|
||||
{
|
||||
Vector2D vector2D = Par.ToGlobal(Par.OP.First().ps.First());
|
||||
MM = new Vector2D[2];
|
||||
MM[0].X = vector2D.X;
|
||||
MM[1].X = vector2D.X;
|
||||
GetMinMaxX(Par, ref MM[0].X, ref MM[1].X);
|
||||
}
|
||||
public static void GetMiX_MaX(this Par Par, out Vector2D[] MM)
|
||||
{
|
||||
Vector2D vector2D = Par.ToGlobal(Par.OP.First().ps.First());
|
||||
MM = new Vector2D[2];
|
||||
MM[0].X = vector2D.X;
|
||||
MM[1].X = vector2D.X;
|
||||
GetMinMaxX(Par, ref MM[0].X, ref MM[1].X);
|
||||
}
|
||||
|
||||
public static void GetMaX_MiX(this Par Par, out Vector2D[] MM)
|
||||
{
|
||||
Vector2D vector2D = Par.ToGlobal(Par.OP.First().ps.First());
|
||||
MM = new Vector2D[2];
|
||||
MM[0].X = vector2D.X;
|
||||
MM[1].X = vector2D.X;
|
||||
GetMinMaxX(Par, ref MM[1].X, ref MM[0].X);
|
||||
}
|
||||
public static void GetMaX_MiX(this Par Par, out Vector2D[] MM)
|
||||
{
|
||||
Vector2D vector2D = Par.ToGlobal(Par.OP.First().ps.First());
|
||||
MM = new Vector2D[2];
|
||||
MM[0].X = vector2D.X;
|
||||
MM[1].X = vector2D.X;
|
||||
GetMinMaxX(Par, ref MM[1].X, ref MM[0].X);
|
||||
}
|
||||
|
||||
public static void GetMiY_MaY(this Par Par, out Vector2D[] MM)
|
||||
{
|
||||
Vector2D vector2D = Par.ToGlobal(Par.OP.First().ps.First());
|
||||
MM = new Vector2D[2];
|
||||
MM[0].Y = vector2D.Y;
|
||||
MM[1].Y = vector2D.Y;
|
||||
GetMinMaxY(Par, ref MM[0].Y, ref MM[1].Y);
|
||||
}
|
||||
public static void GetMiY_MaY(this Par Par, out Vector2D[] MM)
|
||||
{
|
||||
Vector2D vector2D = Par.ToGlobal(Par.OP.First().ps.First());
|
||||
MM = new Vector2D[2];
|
||||
MM[0].Y = vector2D.Y;
|
||||
MM[1].Y = vector2D.Y;
|
||||
GetMinMaxY(Par, ref MM[0].Y, ref MM[1].Y);
|
||||
}
|
||||
|
||||
public static void GetMiY_MaY(this Par[] Pars, out Vector2D[] MM)
|
||||
{
|
||||
Par par = Pars.First();
|
||||
Vector2D vector2D = par.ToGlobal(par.OP.First().ps.First());
|
||||
MM = new Vector2D[2];
|
||||
MM[0].Y = vector2D.Y;
|
||||
MM[1].Y = vector2D.Y;
|
||||
GetMinMaxY(Pars, ref MM[0].Y, ref MM[1].Y);
|
||||
}
|
||||
public static void GetMiY_MaY(this Par[] Pars, out Vector2D[] MM)
|
||||
{
|
||||
Par par = Pars.First();
|
||||
Vector2D vector2D = par.ToGlobal(par.OP.First().ps.First());
|
||||
MM = new Vector2D[2];
|
||||
MM[0].Y = vector2D.Y;
|
||||
MM[1].Y = vector2D.Y;
|
||||
GetMinMaxY(Pars, ref MM[0].Y, ref MM[1].Y);
|
||||
}
|
||||
|
||||
public static void GetMaY_MiY(this Par Par, out Vector2D[] MM)
|
||||
{
|
||||
Vector2D vector2D = Par.ToGlobal(Par.OP.First().ps.First());
|
||||
MM = new Vector2D[2];
|
||||
MM[0].Y = vector2D.Y;
|
||||
MM[1].Y = vector2D.Y;
|
||||
GetMinMaxY(Par, ref MM[1].Y, ref MM[0].Y);
|
||||
}
|
||||
public static void GetMaY_MiY(this Par Par, out Vector2D[] MM)
|
||||
{
|
||||
Vector2D vector2D = Par.ToGlobal(Par.OP.First().ps.First());
|
||||
MM = new Vector2D[2];
|
||||
MM[0].Y = vector2D.Y;
|
||||
MM[1].Y = vector2D.Y;
|
||||
GetMinMaxY(Par, ref MM[1].Y, ref MM[0].Y);
|
||||
}
|
||||
|
||||
public static Obj ObjLoad(this byte[] bd)
|
||||
{
|
||||
return bd.Load<byte[]>().ToDeserialObject<Obj>().SetDefaultR();
|
||||
}
|
||||
public static Obj ObjLoad(this byte[] bd)
|
||||
{
|
||||
return bd.Load<byte[]>().ToDeserialObject<Obj>().SetDefaultR();
|
||||
}
|
||||
|
||||
public static bool Lot(this double p)
|
||||
{
|
||||
return RNG.XS.NextDouble() < p;
|
||||
}
|
||||
public static bool Lot(this double p)
|
||||
{
|
||||
return RNG.XS.NextDouble() < p;
|
||||
}
|
||||
|
||||
public static int GetRandomIndex(params double[] WeightTable)
|
||||
{
|
||||
double les = WeightTable.Sum();
|
||||
double num = RNG.XS.NextDouble(les);
|
||||
int result = -1;
|
||||
for (int i = 0; i < WeightTable.Length; i++)
|
||||
{
|
||||
if (WeightTable[i] >= num)
|
||||
{
|
||||
result = i;
|
||||
break;
|
||||
}
|
||||
num -= WeightTable[i];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
public static int GetRandomIndex(params double[] WeightTable)
|
||||
{
|
||||
double les = WeightTable.Sum();
|
||||
double num = RNG.XS.NextDouble(les);
|
||||
int result = -1;
|
||||
for (int i = 0; i < WeightTable.Length; i++)
|
||||
{
|
||||
if (WeightTable[i] >= num)
|
||||
{
|
||||
result = i;
|
||||
break;
|
||||
}
|
||||
num -= WeightTable[i];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Encoding GetEncoding(this byte[] Bytes)
|
||||
{
|
||||
byte[] array = null;
|
||||
if (Bytes.Length > 4000)
|
||||
{
|
||||
array = new byte[4000];
|
||||
Array.Copy(Bytes, array, 4000);
|
||||
}
|
||||
else
|
||||
{
|
||||
array = Bytes;
|
||||
}
|
||||
int num = array.Length;
|
||||
bool flag = false;
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
byte b = array[i];
|
||||
if (b <= 6 || b == 127 || b == byte.MaxValue)
|
||||
{
|
||||
flag = true;
|
||||
if (b == 0 && i < num - 1 && array[i + 1] <= 127)
|
||||
{
|
||||
return Encoding.Unicode;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (flag)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
bool flag2 = true;
|
||||
byte[] array2 = array;
|
||||
foreach (byte b2 in array2)
|
||||
{
|
||||
if (b2 == 27 || 128 <= b2)
|
||||
{
|
||||
flag2 = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (flag2)
|
||||
{
|
||||
return Encoding.ASCII;
|
||||
}
|
||||
for (int k = 0; k < num - 2; k++)
|
||||
{
|
||||
byte b = array[k];
|
||||
byte b3 = array[k + 1];
|
||||
byte b4 = array[k + 2];
|
||||
if (b != 27)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (b3 == 36 && b4 == 64)
|
||||
{
|
||||
return Encoding.GetEncoding(50220);
|
||||
}
|
||||
if (b3 == 36 && b4 == 66)
|
||||
{
|
||||
return Encoding.GetEncoding(50220);
|
||||
}
|
||||
if (b3 == 40 && (b4 == 66 || b4 == 74))
|
||||
{
|
||||
return Encoding.GetEncoding(50220);
|
||||
}
|
||||
if (b3 == 40 && b4 == 73)
|
||||
{
|
||||
return Encoding.GetEncoding(50220);
|
||||
}
|
||||
if (k < num - 3)
|
||||
{
|
||||
byte b5 = array[k + 3];
|
||||
if (b3 == 36 && b4 == 40 && b5 == 68)
|
||||
{
|
||||
return Encoding.GetEncoding(50220);
|
||||
}
|
||||
if (k < num - 5 && b3 == 38 && b4 == 64 && b5 == 27 && array[k + 4] == 36 && array[k + 5] == 66)
|
||||
{
|
||||
return Encoding.GetEncoding(50220);
|
||||
}
|
||||
}
|
||||
}
|
||||
int num2 = 0;
|
||||
int num3 = 0;
|
||||
int num4 = 0;
|
||||
for (int l = 0; l < num - 1; l++)
|
||||
{
|
||||
byte b = array[l];
|
||||
byte b3 = array[l + 1];
|
||||
if (((129 <= b && b <= 159) || (224 <= b && b <= 252)) && ((64 <= b3 && b3 <= 126) || (128 <= b3 && b3 <= 252)))
|
||||
{
|
||||
num2 += 2;
|
||||
l++;
|
||||
}
|
||||
}
|
||||
for (int m = 0; m < num - 1; m++)
|
||||
{
|
||||
byte b = array[m];
|
||||
byte b3 = array[m + 1];
|
||||
if ((161 <= b && b <= 254 && 161 <= b3 && b3 <= 254) || (b == 142 && 161 <= b3 && b3 <= 223))
|
||||
{
|
||||
num3 += 2;
|
||||
m++;
|
||||
}
|
||||
else if (m < num - 2)
|
||||
{
|
||||
byte b4 = array[m + 2];
|
||||
if (b == 143 && 161 <= b3 && b3 <= 254 && 161 <= b4 && b4 <= 254)
|
||||
{
|
||||
num3 += 3;
|
||||
m += 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int n = 0; n < num - 1; n++)
|
||||
{
|
||||
byte b = array[n];
|
||||
byte b3 = array[n + 1];
|
||||
if (192 <= b && b <= 223 && 128 <= b3 && b3 <= 191)
|
||||
{
|
||||
num4 += 2;
|
||||
n++;
|
||||
}
|
||||
else if (n < num - 2)
|
||||
{
|
||||
byte b4 = array[n + 2];
|
||||
if (224 <= b && b <= 239 && 128 <= b3 && b3 <= 191 && 128 <= b4 && b4 <= 191)
|
||||
{
|
||||
num4 += 3;
|
||||
n += 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (num3 > num2 && num3 > num4)
|
||||
{
|
||||
return Encoding.GetEncoding(51932);
|
||||
}
|
||||
if (num2 > num3 && num2 > num4)
|
||||
{
|
||||
return Encoding.GetEncoding(932);
|
||||
}
|
||||
if (num4 > num3 && num4 > num2)
|
||||
{
|
||||
return Encoding.UTF8;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static Encoding GetEncoding(this byte[] Bytes)
|
||||
{
|
||||
byte[] array = null;
|
||||
if (Bytes.Length > 4000)
|
||||
{
|
||||
array = new byte[4000];
|
||||
Array.Copy(Bytes, array, 4000);
|
||||
}
|
||||
else
|
||||
{
|
||||
array = Bytes;
|
||||
}
|
||||
int num = array.Length;
|
||||
bool flag = false;
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
byte b = array[i];
|
||||
if (b <= 6 || b == 127 || b == byte.MaxValue)
|
||||
{
|
||||
flag = true;
|
||||
if (b == 0 && i < num - 1 && array[i + 1] <= 127)
|
||||
{
|
||||
return Encoding.Unicode;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (flag)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
bool flag2 = true;
|
||||
byte[] array2 = array;
|
||||
foreach (byte b2 in array2)
|
||||
{
|
||||
if (b2 == 27 || 128 <= b2)
|
||||
{
|
||||
flag2 = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (flag2)
|
||||
{
|
||||
return Encoding.ASCII;
|
||||
}
|
||||
for (int k = 0; k < num - 2; k++)
|
||||
{
|
||||
byte b = array[k];
|
||||
byte b3 = array[k + 1];
|
||||
byte b4 = array[k + 2];
|
||||
if (b != 27)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (b3 == 36 && b4 == 64)
|
||||
{
|
||||
return Encoding.GetEncoding(50220);
|
||||
}
|
||||
if (b3 == 36 && b4 == 66)
|
||||
{
|
||||
return Encoding.GetEncoding(50220);
|
||||
}
|
||||
if (b3 == 40 && (b4 == 66 || b4 == 74))
|
||||
{
|
||||
return Encoding.GetEncoding(50220);
|
||||
}
|
||||
if (b3 == 40 && b4 == 73)
|
||||
{
|
||||
return Encoding.GetEncoding(50220);
|
||||
}
|
||||
if (k < num - 3)
|
||||
{
|
||||
byte b5 = array[k + 3];
|
||||
if (b3 == 36 && b4 == 40 && b5 == 68)
|
||||
{
|
||||
return Encoding.GetEncoding(50220);
|
||||
}
|
||||
if (k < num - 5 && b3 == 38 && b4 == 64 && b5 == 27 && array[k + 4] == 36 && array[k + 5] == 66)
|
||||
{
|
||||
return Encoding.GetEncoding(50220);
|
||||
}
|
||||
}
|
||||
}
|
||||
int num2 = 0;
|
||||
int num3 = 0;
|
||||
int num4 = 0;
|
||||
for (int l = 0; l < num - 1; l++)
|
||||
{
|
||||
byte b = array[l];
|
||||
byte b3 = array[l + 1];
|
||||
if (((129 <= b && b <= 159) || (224 <= b && b <= 252)) && ((64 <= b3 && b3 <= 126) || (128 <= b3 && b3 <= 252)))
|
||||
{
|
||||
num2 += 2;
|
||||
l++;
|
||||
}
|
||||
}
|
||||
for (int m = 0; m < num - 1; m++)
|
||||
{
|
||||
byte b = array[m];
|
||||
byte b3 = array[m + 1];
|
||||
if ((161 <= b && b <= 254 && 161 <= b3 && b3 <= 254) || (b == 142 && 161 <= b3 && b3 <= 223))
|
||||
{
|
||||
num3 += 2;
|
||||
m++;
|
||||
}
|
||||
else if (m < num - 2)
|
||||
{
|
||||
byte b4 = array[m + 2];
|
||||
if (b == 143 && 161 <= b3 && b3 <= 254 && 161 <= b4 && b4 <= 254)
|
||||
{
|
||||
num3 += 3;
|
||||
m += 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int n = 0; n < num - 1; n++)
|
||||
{
|
||||
byte b = array[n];
|
||||
byte b3 = array[n + 1];
|
||||
if (192 <= b && b <= 223 && 128 <= b3 && b3 <= 191)
|
||||
{
|
||||
num4 += 2;
|
||||
n++;
|
||||
}
|
||||
else if (n < num - 2)
|
||||
{
|
||||
byte b4 = array[n + 2];
|
||||
if (224 <= b && b <= 239 && 128 <= b3 && b3 <= 191 && 128 <= b4 && b4 <= 191)
|
||||
{
|
||||
num4 += 3;
|
||||
n += 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (num3 > num2 && num3 > num4)
|
||||
{
|
||||
return Encoding.GetEncoding(51932);
|
||||
}
|
||||
if (num2 > num3 && num2 > num4)
|
||||
{
|
||||
return Encoding.GetEncoding(932);
|
||||
}
|
||||
if (num4 > num3 && num4 > num2)
|
||||
{
|
||||
return Encoding.UTF8;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static string Join(this IEnumerable<string> strs, string Separator)
|
||||
{
|
||||
return string.Join(Separator, strs);
|
||||
}
|
||||
public static string Join(this IEnumerable<string> strs, string Separator)
|
||||
{
|
||||
return string.Join(Separator, strs);
|
||||
}
|
||||
|
||||
public static string[] Split(this string str, string Separator)
|
||||
{
|
||||
return str.Split(new string[1] { Separator }, StringSplitOptions.None);
|
||||
}
|
||||
public static string[] Split(this string str, string Separator)
|
||||
{
|
||||
return str.Split(new string[1] { Separator }, StringSplitOptions.None);
|
||||
}
|
||||
|
||||
static Oth()
|
||||
{
|
||||
s1 = 1.01;
|
||||
s0 = s1.Reciprocal();
|
||||
}
|
||||
static Oth()
|
||||
{
|
||||
s1 = 1.01;
|
||||
s0 = s1.Reciprocal();
|
||||
}
|
||||
|
||||
public static void SaveExMod<T>(this T Obj, string Path)
|
||||
{
|
||||
Obj.ToSerialBytes().Save(Path);
|
||||
}
|
||||
public static void SaveExMod<T>(this T Obj, string Path)
|
||||
{
|
||||
Obj.ToSerialBytes().Save(Path);
|
||||
}
|
||||
|
||||
public static T LoadExMod<T>(this string Path)
|
||||
{
|
||||
return Path.Load<byte[]>().ToDeserialObject<T>();
|
||||
}
|
||||
public static T LoadExMod<T>(this string Path)
|
||||
{
|
||||
return Path.Load<byte[]>().ToDeserialObject<T>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,26 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
|
||||
//outline/path/line basically represents a curve :3
|
||||
[Serializable]
|
||||
public class Out
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
public List<Vector2D> ps = new List<Vector2D>();
|
||||
|
||||
public float Tension = 0.5f;
|
||||
public bool Outline = true;
|
||||
//outline/path/line basically represents a curve :3
|
||||
[Serializable]
|
||||
public class Out
|
||||
{
|
||||
public List<Vector2D> ps = new List<Vector2D>();
|
||||
|
||||
public Out()
|
||||
{
|
||||
}
|
||||
public float Tension = 0.5f;
|
||||
public bool Outline = true;
|
||||
|
||||
public Out(Out Out)
|
||||
{
|
||||
ps = new List<Vector2D>(Out.ps);
|
||||
Tension = Out.Tension;
|
||||
Outline = Out.Outline;
|
||||
}
|
||||
public Out()
|
||||
{
|
||||
}
|
||||
|
||||
public Out(Out Out)
|
||||
{
|
||||
ps = new List<Vector2D>(Out.ps);
|
||||
Tension = Out.Tension;
|
||||
Outline = Out.Outline;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -3,373 +3,374 @@ using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
// renders text
|
||||
[Serializable]
|
||||
public class ParT : Par
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
[NonSerialized, JsonIgnore]
|
||||
private Font font = new Font("", 1f);
|
||||
// renders text
|
||||
[Serializable]
|
||||
public class ParT : Par
|
||||
{
|
||||
[NonSerialized, JsonIgnore]
|
||||
private Font font = new Font("", 1f);
|
||||
|
||||
private double fontSize = 1.0;
|
||||
private double fontSize = 1.0;
|
||||
|
||||
private bool EditF = true;
|
||||
private bool EditF = true;
|
||||
|
||||
[NonSerialized, JsonIgnore]
|
||||
private Brush brusht = new SolidBrush(Color.Black);
|
||||
[NonSerialized, JsonIgnore]
|
||||
private Brush brusht = new SolidBrush(Color.Black);
|
||||
|
||||
private const double Shift = 1.0;
|
||||
private const double Shift = 1.0;
|
||||
|
||||
[NonSerialized, JsonIgnore]
|
||||
private Brush brushs;
|
||||
[NonSerialized, JsonIgnore]
|
||||
private Brush brushs;
|
||||
|
||||
[NonSerialized, JsonIgnore]
|
||||
private StringFormat stringformat = new StringFormat();
|
||||
[NonSerialized, JsonIgnore]
|
||||
private StringFormat stringformat = new StringFormat();
|
||||
|
||||
private Vector2D positionT = Dat.Vec2DZero;
|
||||
private Vector2D positionT = Dat.Vec2DZero;
|
||||
|
||||
private Vector2D rectSize = Dat.Vec2DOne;
|
||||
private Vector2D rectSize = Dat.Vec2DOne;
|
||||
|
||||
public string Text = "";
|
||||
public string Text = "";
|
||||
|
||||
private RectangleF rect;
|
||||
private RectangleF rect;
|
||||
|
||||
private double us;
|
||||
private double us;
|
||||
|
||||
private double usx;
|
||||
private double usx;
|
||||
|
||||
private double usy;
|
||||
private double usy;
|
||||
|
||||
private Vector2D bp;
|
||||
private Vector2D bp;
|
||||
|
||||
private Vector2D p;
|
||||
private Vector2D p;
|
||||
|
||||
private Vector2D v;
|
||||
private Vector2D v;
|
||||
|
||||
private double a0;
|
||||
private double a0;
|
||||
|
||||
private double a1;
|
||||
private double a1;
|
||||
|
||||
private double M11;
|
||||
private double M11;
|
||||
|
||||
private double M12;
|
||||
private double M12;
|
||||
|
||||
private float af;
|
||||
private float af;
|
||||
|
||||
private float xf;
|
||||
private float xf;
|
||||
|
||||
private float yf;
|
||||
private float yf;
|
||||
|
||||
private bool EditT = true;
|
||||
private bool EditT = true;
|
||||
|
||||
private bool EditTS = true;
|
||||
private bool EditTS = true;
|
||||
|
||||
private CharacterRange[] crr = new CharacterRange[1];
|
||||
private CharacterRange[] crr = new CharacterRange[1];
|
||||
|
||||
private CharacterRange[] cre = new CharacterRange[1];
|
||||
private CharacterRange[] cre = new CharacterRange[1];
|
||||
|
||||
public Font Font
|
||||
{
|
||||
get
|
||||
{
|
||||
return font;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (font != value && font != null)
|
||||
{
|
||||
font.Dispose();
|
||||
}
|
||||
font = value;
|
||||
EditF = true;
|
||||
}
|
||||
}
|
||||
public Font Font
|
||||
{
|
||||
get
|
||||
{
|
||||
return font;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (font != value && font != null)
|
||||
{
|
||||
font.Dispose();
|
||||
}
|
||||
font = value;
|
||||
EditF = true;
|
||||
}
|
||||
}
|
||||
|
||||
public double FontSize
|
||||
{
|
||||
get
|
||||
{
|
||||
return fontSize;
|
||||
}
|
||||
set
|
||||
{
|
||||
fontSize = value;
|
||||
EditF = true;
|
||||
}
|
||||
}
|
||||
public double FontSize
|
||||
{
|
||||
get
|
||||
{
|
||||
return fontSize;
|
||||
}
|
||||
set
|
||||
{
|
||||
fontSize = value;
|
||||
EditF = true;
|
||||
}
|
||||
}
|
||||
|
||||
public Brush TextBrush
|
||||
{
|
||||
get
|
||||
{
|
||||
return brusht;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (brusht != value && brusht != null)
|
||||
{
|
||||
brusht.Dispose();
|
||||
}
|
||||
brusht = value;
|
||||
}
|
||||
}
|
||||
public Brush TextBrush
|
||||
{
|
||||
get
|
||||
{
|
||||
return brusht;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (brusht != value && brusht != null)
|
||||
{
|
||||
brusht.Dispose();
|
||||
}
|
||||
brusht = value;
|
||||
}
|
||||
}
|
||||
|
||||
public Color TextColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return ((SolidBrush)brusht).Color;
|
||||
}
|
||||
set
|
||||
{
|
||||
((SolidBrush)brusht).Color = value;
|
||||
}
|
||||
}
|
||||
public Color TextColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return ((SolidBrush)brusht).Color;
|
||||
}
|
||||
set
|
||||
{
|
||||
((SolidBrush)brusht).Color = value;
|
||||
}
|
||||
}
|
||||
|
||||
public Brush ShadBrush
|
||||
{
|
||||
get
|
||||
{
|
||||
return brushs;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (brushs != value && brushs != null)
|
||||
{
|
||||
brushs.Dispose();
|
||||
}
|
||||
brushs = value;
|
||||
}
|
||||
}
|
||||
public Brush ShadBrush
|
||||
{
|
||||
get
|
||||
{
|
||||
return brushs;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (brushs != value && brushs != null)
|
||||
{
|
||||
brushs.Dispose();
|
||||
}
|
||||
brushs = value;
|
||||
}
|
||||
}
|
||||
|
||||
public Color ShadColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return ((SolidBrush)brushs).Color;
|
||||
}
|
||||
set
|
||||
{
|
||||
((SolidBrush)brushs).Color = value;
|
||||
}
|
||||
}
|
||||
public Color ShadColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return ((SolidBrush)brushs).Color;
|
||||
}
|
||||
set
|
||||
{
|
||||
((SolidBrush)brushs).Color = value;
|
||||
}
|
||||
}
|
||||
|
||||
public StringFormat StringFormat
|
||||
{
|
||||
get
|
||||
{
|
||||
return stringformat;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (stringformat != value && stringformat != null)
|
||||
{
|
||||
stringformat.Dispose();
|
||||
}
|
||||
stringformat = value;
|
||||
}
|
||||
}
|
||||
public StringFormat StringFormat
|
||||
{
|
||||
get
|
||||
{
|
||||
return stringformat;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (stringformat != value && stringformat != null)
|
||||
{
|
||||
stringformat.Dispose();
|
||||
}
|
||||
stringformat = value;
|
||||
}
|
||||
}
|
||||
|
||||
public Vector2D PositionT
|
||||
{
|
||||
get
|
||||
{
|
||||
return positionT;
|
||||
}
|
||||
set
|
||||
{
|
||||
positionT = value;
|
||||
EditT = true;
|
||||
}
|
||||
}
|
||||
public Vector2D PositionT
|
||||
{
|
||||
get
|
||||
{
|
||||
return positionT;
|
||||
}
|
||||
set
|
||||
{
|
||||
positionT = value;
|
||||
EditT = true;
|
||||
}
|
||||
}
|
||||
|
||||
public Vector2D RectSize
|
||||
{
|
||||
get
|
||||
{
|
||||
return rectSize;
|
||||
}
|
||||
set
|
||||
{
|
||||
rectSize = value;
|
||||
EditT = true;
|
||||
}
|
||||
}
|
||||
public Vector2D RectSize
|
||||
{
|
||||
get
|
||||
{
|
||||
return rectSize;
|
||||
}
|
||||
set
|
||||
{
|
||||
rectSize = value;
|
||||
EditT = true;
|
||||
}
|
||||
}
|
||||
|
||||
public new void SetDefault()
|
||||
{
|
||||
base.SetDefault();
|
||||
font = new Font("", 1f);
|
||||
brusht = new SolidBrush(Color.Black);
|
||||
brushs = null;
|
||||
stringformat = new StringFormat();
|
||||
}
|
||||
public new void SetDefault()
|
||||
{
|
||||
base.SetDefault();
|
||||
font = new Font("", 1f);
|
||||
brusht = new SolidBrush(Color.Black);
|
||||
brushs = null;
|
||||
stringformat = new StringFormat();
|
||||
}
|
||||
|
||||
public ParT()
|
||||
{
|
||||
}
|
||||
public ParT()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public ParT(ParT ParT)
|
||||
{
|
||||
CopyT(ParT);
|
||||
}
|
||||
public ParT(ParT ParT)
|
||||
{
|
||||
CopyT(ParT);
|
||||
}
|
||||
|
||||
private void CopyT(ParT ParT)
|
||||
{
|
||||
Copy(ParT);
|
||||
fontSize = ParT.fontSize;
|
||||
if (ParT.font != null)
|
||||
{
|
||||
Font = ParT.font.Copy();
|
||||
}
|
||||
if (ParT.brusht != null)
|
||||
{
|
||||
TextBrush = ParT.brusht.Copy();
|
||||
}
|
||||
if (ParT.brushs != null)
|
||||
{
|
||||
ShadBrush = ParT.brushs.Copy();
|
||||
}
|
||||
if (ParT.stringformat != null)
|
||||
{
|
||||
StringFormat = ParT.stringformat.Copy();
|
||||
}
|
||||
positionT = ParT.positionT;
|
||||
rectSize = ParT.rectSize;
|
||||
Text = ParT.Text;
|
||||
}
|
||||
private void CopyT(ParT ParT)
|
||||
{
|
||||
Copy(ParT);
|
||||
fontSize = ParT.fontSize;
|
||||
if (ParT.font != null)
|
||||
{
|
||||
Font = ParT.font.Copy();
|
||||
}
|
||||
if (ParT.brusht != null)
|
||||
{
|
||||
TextBrush = ParT.brusht.Copy();
|
||||
}
|
||||
if (ParT.brushs != null)
|
||||
{
|
||||
ShadBrush = ParT.brushs.Copy();
|
||||
}
|
||||
if (ParT.stringformat != null)
|
||||
{
|
||||
StringFormat = ParT.stringformat.Copy();
|
||||
}
|
||||
positionT = ParT.positionT;
|
||||
rectSize = ParT.rectSize;
|
||||
Text = ParT.Text;
|
||||
}
|
||||
|
||||
public new void Draw(double Unit, Graphics Graphics)
|
||||
{
|
||||
if (Edit)
|
||||
{
|
||||
EditT = true;
|
||||
}
|
||||
if (EditS || EditPS)
|
||||
{
|
||||
EditTS = true;
|
||||
}
|
||||
base.Draw(Unit, Graphics);
|
||||
DrawString(Unit, Graphics);
|
||||
}
|
||||
public new void Draw(double Unit, Graphics Graphics)
|
||||
{
|
||||
if (Edit)
|
||||
{
|
||||
EditT = true;
|
||||
}
|
||||
if (EditS || EditPS)
|
||||
{
|
||||
EditTS = true;
|
||||
}
|
||||
base.Draw(Unit, Graphics);
|
||||
DrawString(Unit, Graphics);
|
||||
}
|
||||
|
||||
private void Calculation(double Unit)
|
||||
{
|
||||
us = Unit * base.Size;
|
||||
usx = us * base.SizeX;
|
||||
usy = us * base.SizeY;
|
||||
bp = base.BasePoint;
|
||||
bp.X *= usx;
|
||||
bp.Y *= usy;
|
||||
a0 = base.Angle;
|
||||
a1 = System.Math.PI * a0 / 180.0;
|
||||
M11 = System.Math.Cos(a1);
|
||||
M12 = System.Math.Sin(a1);
|
||||
v.X = bp.X * M11 + bp.Y * (0.0 - M12);
|
||||
v.Y = bp.X * M12 + bp.Y * M11;
|
||||
p = base.Position;
|
||||
bp.X = p.X * Unit - v.X;
|
||||
bp.Y = p.Y * Unit - v.Y;
|
||||
rect.X = (float)(positionT.X * us);
|
||||
rect.Y = (float)(positionT.Y * us);
|
||||
rect.Width = (float)(rectSize.X * us);
|
||||
rect.Height = (float)(rectSize.Y * us);
|
||||
}
|
||||
private void Calculation(double Unit)
|
||||
{
|
||||
us = Unit * base.Size;
|
||||
usx = us * base.SizeX;
|
||||
usy = us * base.SizeY;
|
||||
bp = base.BasePoint;
|
||||
bp.X *= usx;
|
||||
bp.Y *= usy;
|
||||
a0 = base.Angle;
|
||||
a1 = System.Math.PI * a0 / 180.0;
|
||||
M11 = System.Math.Cos(a1);
|
||||
M12 = System.Math.Sin(a1);
|
||||
v.X = bp.X * M11 + bp.Y * (0.0 - M12);
|
||||
v.Y = bp.X * M12 + bp.Y * M11;
|
||||
p = base.Position;
|
||||
bp.X = p.X * Unit - v.X;
|
||||
bp.Y = p.Y * Unit - v.Y;
|
||||
rect.X = (float)(positionT.X * us);
|
||||
rect.Y = (float)(positionT.Y * us);
|
||||
rect.Width = (float)(rectSize.X * us);
|
||||
rect.Height = (float)(rectSize.Y * us);
|
||||
}
|
||||
|
||||
private void DrawString(double Unit, Graphics Graphics)
|
||||
{
|
||||
if (EditT)
|
||||
{
|
||||
Calculation(Unit);
|
||||
EditT = false;
|
||||
}
|
||||
if (EditF || EditTS)
|
||||
{
|
||||
Font = new Font(font.FontFamily, (float)(us * fontSize * Med.DpiY));
|
||||
EditF = false;
|
||||
EditTS = false;
|
||||
}
|
||||
af = (float)a0;
|
||||
xf = (float)base.SizeX;
|
||||
yf = (float)base.SizeY;
|
||||
if (brushs != null)
|
||||
{
|
||||
Graphics.TranslateTransform((float)(bp.X + 1.0), (float)(bp.Y + 1.0));
|
||||
Graphics.RotateTransform(af);
|
||||
Graphics.ScaleTransform(xf, yf);
|
||||
Graphics.DrawString(Text, font, brushs, rect, stringformat);
|
||||
Graphics.ResetTransform();
|
||||
}
|
||||
Graphics.TranslateTransform((float)bp.X, (float)bp.Y);
|
||||
Graphics.RotateTransform(af);
|
||||
Graphics.ScaleTransform(xf, yf);
|
||||
Graphics.DrawString(Text, font, brusht, rect, stringformat);
|
||||
Graphics.ResetTransform();
|
||||
}
|
||||
private void DrawString(double Unit, Graphics Graphics)
|
||||
{
|
||||
if (EditT)
|
||||
{
|
||||
Calculation(Unit);
|
||||
EditT = false;
|
||||
}
|
||||
if (EditF || EditTS)
|
||||
{
|
||||
Font = new Font(font.FontFamily, (float)(us * fontSize * Med.DpiY));
|
||||
EditF = false;
|
||||
EditTS = false;
|
||||
}
|
||||
af = (float)a0;
|
||||
xf = (float)base.SizeX;
|
||||
yf = (float)base.SizeY;
|
||||
if (brushs != null)
|
||||
{
|
||||
Graphics.TranslateTransform((float)(bp.X + 1.0), (float)(bp.Y + 1.0));
|
||||
Graphics.RotateTransform(af);
|
||||
Graphics.ScaleTransform(xf, yf);
|
||||
Graphics.DrawString(Text, font, brushs, rect, stringformat);
|
||||
Graphics.ResetTransform();
|
||||
}
|
||||
Graphics.TranslateTransform((float)bp.X, (float)bp.Y);
|
||||
Graphics.RotateTransform(af);
|
||||
Graphics.ScaleTransform(xf, yf);
|
||||
Graphics.DrawString(Text, font, brusht, rect, stringformat);
|
||||
Graphics.ResetTransform();
|
||||
}
|
||||
|
||||
public Vector2D_2 GetStringRect(double Unit, Graphics Graphics)
|
||||
{
|
||||
double num = Unit * base.Size;
|
||||
if (EditF || EditS || EditPS || EditTS)
|
||||
{
|
||||
Font = new Font(font.FontFamily, (float)(num * fontSize * Med.DpiY));
|
||||
EditF = false;
|
||||
EditTS = false;
|
||||
}
|
||||
crr[0] = new CharacterRange(0, Text.Length);
|
||||
stringformat.SetMeasurableCharacterRanges(crr);
|
||||
RectangleF bounds = Graphics.MeasureCharacterRanges(Text, font, new RectangleF((float)(positionT.X * num), (float)(positionT.Y * num), (float)(rectSize.X * num), (float)(rectSize.Y * num)), stringformat)[0].GetBounds(Graphics);
|
||||
return new Vector2D_2(new Vector2D((double)bounds.X / num, (double)bounds.Y / num), new Vector2D((double)bounds.Width / num, (double)bounds.Height / num));
|
||||
}
|
||||
public Vector2D_2 GetStringRect(double Unit, Graphics Graphics)
|
||||
{
|
||||
double num = Unit * base.Size;
|
||||
if (EditF || EditS || EditPS || EditTS)
|
||||
{
|
||||
Font = new Font(font.FontFamily, (float)(num * fontSize * Med.DpiY));
|
||||
EditF = false;
|
||||
EditTS = false;
|
||||
}
|
||||
crr[0] = new CharacterRange(0, Text.Length);
|
||||
stringformat.SetMeasurableCharacterRanges(crr);
|
||||
RectangleF bounds = Graphics.MeasureCharacterRanges(Text, font, new RectangleF((float)(positionT.X * num), (float)(positionT.Y * num), (float)(rectSize.X * num), (float)(rectSize.Y * num)), stringformat)[0].GetBounds(Graphics);
|
||||
return new Vector2D_2(new Vector2D((double)bounds.X / num, (double)bounds.Y / num), new Vector2D((double)bounds.Width / num, (double)bounds.Height / num));
|
||||
}
|
||||
|
||||
public Vector2D[] GetStringRectPoints(double Unit, Graphics Graphics)
|
||||
{
|
||||
Vector2D_2 stringRect = GetStringRect(Unit, Graphics);
|
||||
stringRect.v2.X *= 1.07;
|
||||
return new Vector2D[4]
|
||||
{
|
||||
stringRect.v1,
|
||||
new Vector2D(stringRect.v2.X, stringRect.v1.Y),
|
||||
stringRect.v2,
|
||||
new Vector2D(stringRect.v1.X, stringRect.v2.Y)
|
||||
};
|
||||
}
|
||||
public void SetStringRectOutline(double Unit, Graphics Graphics)
|
||||
{
|
||||
Vector2D[] stringRectPoints = GetStringRectPoints(Unit, Graphics);
|
||||
Out @out = new Out
|
||||
{
|
||||
Tension = 0f
|
||||
};
|
||||
Vector2D vector2D = Dat.Vec2DZero - stringRectPoints[0];
|
||||
double x = 0.05;
|
||||
double num = 0.025;
|
||||
@out.ps.Add(stringRectPoints[0].AddY(0.0 - num) + vector2D);
|
||||
@out.ps.Add(stringRectPoints[1].AddXY(x, 0.0 - num) + vector2D);
|
||||
@out.ps.Add(stringRectPoints[2].AddXY(x, num) + vector2D);
|
||||
@out.ps.Add(stringRectPoints[3].AddY(num) + vector2D);
|
||||
base.OP.Add(@out);
|
||||
}
|
||||
public new void Dispose()
|
||||
{
|
||||
base.Dispose();
|
||||
if (font != null)
|
||||
{
|
||||
font.Dispose();
|
||||
}
|
||||
if (brusht != null)
|
||||
{
|
||||
brusht.Dispose();
|
||||
}
|
||||
if (brushs != null)
|
||||
{
|
||||
brushs.Dispose();
|
||||
}
|
||||
if (stringformat != null)
|
||||
{
|
||||
stringformat.Dispose();
|
||||
}
|
||||
}
|
||||
public Vector2D[] GetStringRectPoints(double Unit, Graphics Graphics)
|
||||
{
|
||||
Vector2D_2 stringRect = GetStringRect(Unit, Graphics);
|
||||
stringRect.v2.X *= 1.07;
|
||||
return new Vector2D[4]
|
||||
{
|
||||
stringRect.v1,
|
||||
new Vector2D(stringRect.v2.X, stringRect.v1.Y),
|
||||
stringRect.v2,
|
||||
new Vector2D(stringRect.v1.X, stringRect.v2.Y)
|
||||
};
|
||||
}
|
||||
public void SetStringRectOutline(double Unit, Graphics Graphics)
|
||||
{
|
||||
Vector2D[] stringRectPoints = GetStringRectPoints(Unit, Graphics);
|
||||
Out @out = new Out
|
||||
{
|
||||
Tension = 0f
|
||||
};
|
||||
Vector2D vector2D = Dat.Vec2DZero - stringRectPoints[0];
|
||||
double x = 0.05;
|
||||
double num = 0.025;
|
||||
@out.ps.Add(stringRectPoints[0].AddY(0.0 - num) + vector2D);
|
||||
@out.ps.Add(stringRectPoints[1].AddXY(x, 0.0 - num) + vector2D);
|
||||
@out.ps.Add(stringRectPoints[2].AddXY(x, num) + vector2D);
|
||||
@out.ps.Add(stringRectPoints[3].AddY(num) + vector2D);
|
||||
base.OP.Add(@out);
|
||||
}
|
||||
public new void Dispose()
|
||||
{
|
||||
base.Dispose();
|
||||
if (font != null)
|
||||
{
|
||||
font.Dispose();
|
||||
}
|
||||
if (brusht != null)
|
||||
{
|
||||
brusht.Dispose();
|
||||
}
|
||||
if (brushs != null)
|
||||
{
|
||||
brushs.Dispose();
|
||||
}
|
||||
if (stringformat != null)
|
||||
{
|
||||
stringformat.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,51 +1,52 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
public static class Qua
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
public static QuaternionD RotationZQ(this double angle)
|
||||
public static class Qua
|
||||
{
|
||||
double num = angle * 0.5;
|
||||
QuaternionD result = default(QuaternionD);
|
||||
result.X = 0.0;
|
||||
result.Y = 0.0;
|
||||
result.Z = System.Math.Sin(num);
|
||||
result.W = System.Math.Cos(num);
|
||||
return result;
|
||||
public static QuaternionD RotationZQ(this double angle)
|
||||
{
|
||||
double num = angle * 0.5;
|
||||
QuaternionD result = default(QuaternionD);
|
||||
result.X = 0.0;
|
||||
result.Y = 0.0;
|
||||
result.Z = System.Math.Sin(num);
|
||||
result.W = System.Math.Cos(num);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static void TransformCoordinate(ref Vector2D coord, ref QuaternionD rotation, out Vector2D result)
|
||||
{
|
||||
double num = rotation.Y + rotation.Y;
|
||||
double num2 = rotation.Z + rotation.Z;
|
||||
double num3 = rotation.W * num2;
|
||||
double num4 = rotation.X * num;
|
||||
double num5 = rotation.Z * num2;
|
||||
result.X = coord.X * (1.0 - rotation.Y * num - num5) + coord.Y * (num4 - num3);
|
||||
result.Y = coord.X * (num4 + num3) + coord.Y * (1.0 - rotation.X * (rotation.X + rotation.X) - num5);
|
||||
}
|
||||
|
||||
public static Vector2D TransformCoordinateBP(this Vector2D coord, Vector2D BasePoint, QuaternionD rotation)
|
||||
{
|
||||
Vec.Subtract(ref coord, ref BasePoint, out coord);
|
||||
TransformCoordinate(ref coord, ref rotation, out var result);
|
||||
Vec.Add(ref result, ref BasePoint, out result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
public static void TransformCoordinate(ref Vector2D coord, ref QuaternionD rotation, out Vector2D result)
|
||||
{
|
||||
double num = rotation.Y + rotation.Y;
|
||||
double num2 = rotation.Z + rotation.Z;
|
||||
double num3 = rotation.W * num2;
|
||||
double num4 = rotation.X * num;
|
||||
double num5 = rotation.Z * num2;
|
||||
result.X = coord.X * (1.0 - rotation.Y * num - num5) + coord.Y * (num4 - num3);
|
||||
result.Y = coord.X * (num4 + num3) + coord.Y * (1.0 - rotation.X * (rotation.X + rotation.X) - num5);
|
||||
}
|
||||
|
||||
public static Vector2D TransformCoordinateBP(this Vector2D coord, Vector2D BasePoint, QuaternionD rotation)
|
||||
//used in a total of 1 places
|
||||
[Serializable]
|
||||
public struct QuaternionD
|
||||
{
|
||||
Vec.Subtract(ref coord, ref BasePoint, out coord);
|
||||
TransformCoordinate(ref coord, ref rotation, out var result);
|
||||
Vec.Add(ref result, ref BasePoint, out result);
|
||||
return result;
|
||||
public double X;
|
||||
|
||||
public double Y;
|
||||
|
||||
public double Z;
|
||||
|
||||
public double W;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//used in a total of 1 places
|
||||
[Serializable]
|
||||
public struct QuaternionD
|
||||
{
|
||||
public double X;
|
||||
|
||||
public double Y;
|
||||
|
||||
public double Z;
|
||||
|
||||
public double W;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
public static class RNG
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
public static MyRandom XS = new MyRandom((uint)(Environment.TickCount + DateTime.Now.ToBinary()));
|
||||
public static class RNG
|
||||
{
|
||||
public static MyRandom XS = new MyRandom((uint)(Environment.TickCount + DateTime.Now.ToBinary()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,47 +1,48 @@
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
public class Rect
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
public double XRatio = 1.0;
|
||||
public class Rect
|
||||
{
|
||||
public double XRatio = 1.0;
|
||||
|
||||
public double YRatio = 1.0;
|
||||
public double YRatio = 1.0;
|
||||
|
||||
public double Size = 1.0;
|
||||
public double Size = 1.0;
|
||||
|
||||
public double LocalWidth => XRatio * Size;
|
||||
public double LocalWidth => XRatio * Size;
|
||||
|
||||
public double LocalHeight => YRatio * Size;
|
||||
public double LocalHeight => YRatio * Size;
|
||||
|
||||
public Vector2D LocalCenter => new Vector2D(LocalWidth * 0.5, LocalHeight * 0.5);
|
||||
public Vector2D LocalCenter => new Vector2D(LocalWidth * 0.5, LocalHeight * 0.5);
|
||||
|
||||
public Rect()
|
||||
{
|
||||
}
|
||||
public Rect()
|
||||
{
|
||||
}
|
||||
|
||||
public Rect(double XRatio, double YRatio, double Size)
|
||||
{
|
||||
SetXYRatio(XRatio, YRatio);
|
||||
this.Size = Size;
|
||||
}
|
||||
public Rect(double XRatio, double YRatio, double Size)
|
||||
{
|
||||
SetXYRatio(XRatio, YRatio);
|
||||
this.Size = Size;
|
||||
}
|
||||
|
||||
public void SetXYRatio(double X, double Y)
|
||||
{
|
||||
XRatio = X / Y;
|
||||
YRatio = 1.0;
|
||||
}
|
||||
public void SetXYRatio(double X, double Y)
|
||||
{
|
||||
XRatio = X / Y;
|
||||
YRatio = 1.0;
|
||||
}
|
||||
|
||||
public Vector2D GetPosition(double X, double Y)
|
||||
{
|
||||
return new Vector2D(LocalWidth * X, LocalHeight * Y);
|
||||
}
|
||||
public Vector2D GetPosition(double X, double Y)
|
||||
{
|
||||
return new Vector2D(LocalWidth * X, LocalHeight * Y);
|
||||
}
|
||||
|
||||
public Vector2D GetPosition(Vector2D p)
|
||||
{
|
||||
return new Vector2D(LocalWidth * p.X, LocalHeight * p.Y);
|
||||
}
|
||||
public Vector2D GetPosition(Vector2D p)
|
||||
{
|
||||
return new Vector2D(LocalWidth * p.X, LocalHeight * p.Y);
|
||||
}
|
||||
|
||||
public Vector2D GetPosition(ref Vector2D p)
|
||||
{
|
||||
return new Vector2D(LocalWidth * p.X, LocalHeight * p.Y);
|
||||
}
|
||||
public Vector2D GetPosition(ref Vector2D p)
|
||||
{
|
||||
return new Vector2D(LocalWidth * p.X, LocalHeight * p.Y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,80 +1,81 @@
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
|
||||
//Basically used to animate switching between two static images
|
||||
public class Sce
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
private Bitmap Start;
|
||||
|
||||
private Graphics GS;
|
||||
//Basically used to animate switching between two static images
|
||||
public class Sce
|
||||
{
|
||||
private Bitmap Start;
|
||||
|
||||
private Bitmap End;
|
||||
private Graphics GS;
|
||||
|
||||
private Graphics GE;
|
||||
private Bitmap End;
|
||||
|
||||
private int w;
|
||||
private Graphics GE;
|
||||
|
||||
private int h;
|
||||
private int w;
|
||||
|
||||
private int o;
|
||||
private int h;
|
||||
|
||||
private Rectangle r;
|
||||
private int o;
|
||||
|
||||
private ColorMatrix cm = new ColorMatrix();
|
||||
private Rectangle r;
|
||||
|
||||
private ImageAttributes ia = new ImageAttributes();
|
||||
private ColorMatrix cm = new ColorMatrix();
|
||||
|
||||
public Sce(int Width, int Height)
|
||||
{
|
||||
w = Width;
|
||||
h = Height;
|
||||
Start = new Bitmap(w, h);
|
||||
GS = Graphics.FromImage(Start);
|
||||
End = new Bitmap(w, h);
|
||||
GE = Graphics.FromImage(End);
|
||||
r = new Rectangle(0, 0, w, h);
|
||||
}
|
||||
private ImageAttributes ia = new ImageAttributes();
|
||||
|
||||
public void TransformAlpha(Graphics Graphics, double Rate)
|
||||
{
|
||||
Graphics.DrawImage(Start, 0, 0);
|
||||
cm.Matrix33 = (float)Rate;
|
||||
ia.SetColorMatrix(cm);
|
||||
Graphics.DrawImage(End, r, 0, 0, w, h, GraphicsUnit.Pixel, ia);
|
||||
}
|
||||
public Sce(int Width, int Height)
|
||||
{
|
||||
w = Width;
|
||||
h = Height;
|
||||
Start = new Bitmap(w, h);
|
||||
GS = Graphics.FromImage(Start);
|
||||
End = new Bitmap(w, h);
|
||||
GE = Graphics.FromImage(End);
|
||||
r = new Rectangle(0, 0, w, h);
|
||||
}
|
||||
|
||||
public void TransD(Graphics Graphics, double Rate)
|
||||
{
|
||||
Graphics.DrawImage(End, 0, 0);
|
||||
cm.Matrix33 = (float)Rate.Inverse();
|
||||
ia.SetColorMatrix(cm);
|
||||
Graphics.DrawImage(Start, r, 0, 0, w, h, GraphicsUnit.Pixel, ia);
|
||||
}
|
||||
public void TransformAlpha(Graphics Graphics, double Rate)
|
||||
{
|
||||
Graphics.DrawImage(Start, 0, 0);
|
||||
cm.Matrix33 = (float)Rate;
|
||||
ia.SetColorMatrix(cm);
|
||||
Graphics.DrawImage(End, r, 0, 0, w, h, GraphicsUnit.Pixel, ia);
|
||||
}
|
||||
|
||||
public void DrawStart(Are Are)
|
||||
{
|
||||
Are.Draw(GS);
|
||||
}
|
||||
public void TransD(Graphics Graphics, double Rate)
|
||||
{
|
||||
Graphics.DrawImage(End, 0, 0);
|
||||
cm.Matrix33 = (float)Rate.Inverse();
|
||||
ia.SetColorMatrix(cm);
|
||||
Graphics.DrawImage(Start, r, 0, 0, w, h, GraphicsUnit.Pixel, ia);
|
||||
}
|
||||
|
||||
public void DrawEnd(Are Are)
|
||||
{
|
||||
Are.Draw(GE);
|
||||
}
|
||||
public void DrawStart(Are Are)
|
||||
{
|
||||
Are.Draw(GS);
|
||||
}
|
||||
|
||||
public void ClearStart(ref Color ClearColor)
|
||||
{
|
||||
GS.Clear(ClearColor);
|
||||
}
|
||||
public void DrawEnd(Are Are)
|
||||
{
|
||||
Are.Draw(GE);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Start.Dispose();
|
||||
GS.Dispose();
|
||||
End.Dispose();
|
||||
GE.Dispose();
|
||||
ia.Dispose();
|
||||
}
|
||||
public void ClearStart(ref Color ClearColor)
|
||||
{
|
||||
GS.Clear(ClearColor);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Start.Dispose();
|
||||
GS.Dispose();
|
||||
End.Dispose();
|
||||
GE.Dispose();
|
||||
ia.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,90 +3,91 @@ using System.IO;
|
||||
using System.Runtime.Serialization.Formatters.Binary;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
|
||||
//serialization stuff
|
||||
public static class Ser
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
private static SerializableAttribute s = new SerializableAttribute();
|
||||
|
||||
public static T DeepCopy<T>(this T Object)
|
||||
{
|
||||
BinaryFormatter binaryFormatter = new BinaryFormatter();
|
||||
using MemoryStream memoryStream = new MemoryStream();
|
||||
binaryFormatter.Serialize(memoryStream, Object);
|
||||
memoryStream.Position = 0L;
|
||||
return (T)binaryFormatter.Deserialize(memoryStream);
|
||||
}
|
||||
//serialization stuff
|
||||
public static class Ser
|
||||
{
|
||||
private static SerializableAttribute s = new SerializableAttribute();
|
||||
|
||||
public static byte[] ToSerialBytes<T>(this T Object)
|
||||
{
|
||||
using MemoryStream memoryStream = new MemoryStream();
|
||||
new BinaryFormatter().Serialize(memoryStream, Object);
|
||||
return memoryStream.ToArray();
|
||||
}
|
||||
public static T DeepCopy<T>(this T Object)
|
||||
{
|
||||
BinaryFormatter binaryFormatter = new BinaryFormatter();
|
||||
using MemoryStream memoryStream = new MemoryStream();
|
||||
binaryFormatter.Serialize(memoryStream, Object);
|
||||
memoryStream.Position = 0L;
|
||||
return (T)binaryFormatter.Deserialize(memoryStream);
|
||||
}
|
||||
|
||||
public static T ToDeserialObject<T>(this byte[] Bytes)
|
||||
{
|
||||
using MemoryStream serializationStream = new MemoryStream(Bytes);
|
||||
return (T)new BinaryFormatter().Deserialize(serializationStream);
|
||||
}
|
||||
public static byte[] ToSerialBytes<T>(this T Object)
|
||||
{
|
||||
using MemoryStream memoryStream = new MemoryStream();
|
||||
new BinaryFormatter().Serialize(memoryStream, Object);
|
||||
return memoryStream.ToArray();
|
||||
}
|
||||
|
||||
public static void Save<T>(this T Object, string Path)
|
||||
{
|
||||
using FileStream serializationStream = new FileStream(Path, FileMode.Create, FileAccess.Write);
|
||||
new BinaryFormatter().Serialize(serializationStream, Object);
|
||||
}
|
||||
public static T ToDeserialObject<T>(this byte[] Bytes)
|
||||
{
|
||||
using MemoryStream serializationStream = new MemoryStream(Bytes);
|
||||
return (T)new BinaryFormatter().Deserialize(serializationStream);
|
||||
}
|
||||
|
||||
public static T Load<T>(this string Path)
|
||||
{
|
||||
using FileStream serializationStream = new FileStream(Path, FileMode.Open, FileAccess.Read);
|
||||
return (T)new BinaryFormatter().Deserialize(serializationStream);
|
||||
}
|
||||
public static void Save<T>(this T Object, string Path)
|
||||
{
|
||||
using FileStream serializationStream = new FileStream(Path, FileMode.Create, FileAccess.Write);
|
||||
new BinaryFormatter().Serialize(serializationStream, Object);
|
||||
}
|
||||
|
||||
public static T Load<T>(this byte[] bd)
|
||||
{
|
||||
using MemoryStream serializationStream = new MemoryStream(bd);
|
||||
return (T)new BinaryFormatter().Deserialize(serializationStream);
|
||||
}
|
||||
/*
|
||||
public static void ToXml<T>(this T Object, string Path)
|
||||
{
|
||||
using FileStream output = new FileStream(Path, FileMode.Create, FileAccess.Write);
|
||||
using XmlWriter writer = XmlWriter.Create(output, new XmlWriterSettings
|
||||
{
|
||||
Indent = true
|
||||
});
|
||||
new DataContractSerializer(typeof(T)).WriteObject(writer, Object);
|
||||
}
|
||||
public static T Load<T>(this string Path)
|
||||
{
|
||||
using FileStream serializationStream = new FileStream(Path, FileMode.Open, FileAccess.Read);
|
||||
return (T)new BinaryFormatter().Deserialize(serializationStream);
|
||||
}
|
||||
|
||||
public static T FromXml<T>(this string Path)
|
||||
{
|
||||
using FileStream input = new FileStream(Path, FileMode.Open, FileAccess.Read);
|
||||
using XmlReader reader = XmlReader.Create(input);
|
||||
return (T)new DataContractSerializer(typeof(T)).ReadObject(reader);
|
||||
}
|
||||
*/
|
||||
static Ser(){}
|
||||
public static T Load<T>(this byte[] bd)
|
||||
{
|
||||
using MemoryStream serializationStream = new MemoryStream(bd);
|
||||
return (T)new BinaryFormatter().Deserialize(serializationStream);
|
||||
}
|
||||
/*
|
||||
public static void ToXml<T>(this T Object, string Path)
|
||||
{
|
||||
using FileStream output = new FileStream(Path, FileMode.Create, FileAccess.Write);
|
||||
using XmlWriter writer = XmlWriter.Create(output, new XmlWriterSettings
|
||||
{
|
||||
Indent = true
|
||||
});
|
||||
new DataContractSerializer(typeof(T)).WriteObject(writer, Object);
|
||||
}
|
||||
|
||||
public static void ToJson<T>(this T Object, string Path)
|
||||
{
|
||||
using StreamWriter textWriter = File.CreateText(Path);
|
||||
JsonSerializer jsonSerializer = new JsonSerializer();
|
||||
jsonSerializer.PreserveReferencesHandling = PreserveReferencesHandling.Objects;
|
||||
jsonSerializer.TypeNameHandling = TypeNameHandling.All;
|
||||
jsonSerializer.Formatting = Newtonsoft.Json.Formatting.Indented;
|
||||
jsonSerializer.Serialize(textWriter, Object);
|
||||
}
|
||||
public static T FromXml<T>(this string Path)
|
||||
{
|
||||
using FileStream input = new FileStream(Path, FileMode.Open, FileAccess.Read);
|
||||
using XmlReader reader = XmlReader.Create(input);
|
||||
return (T)new DataContractSerializer(typeof(T)).ReadObject(reader);
|
||||
}
|
||||
*/
|
||||
static Ser(){}
|
||||
|
||||
public static T UnJson<T>(string Path)
|
||||
{
|
||||
using StreamReader reader = File.OpenText(Path);
|
||||
return (T)new JsonSerializer
|
||||
{
|
||||
NullValueHandling = NullValueHandling.Ignore,
|
||||
TypeNameHandling = TypeNameHandling.All
|
||||
}.Deserialize(reader, typeof(T));
|
||||
}
|
||||
public static void ToJson<T>(this T Object, string Path)
|
||||
{
|
||||
using StreamWriter textWriter = File.CreateText(Path);
|
||||
JsonSerializer jsonSerializer = new JsonSerializer();
|
||||
jsonSerializer.PreserveReferencesHandling = PreserveReferencesHandling.Objects;
|
||||
jsonSerializer.TypeNameHandling = TypeNameHandling.All;
|
||||
jsonSerializer.Formatting = Newtonsoft.Json.Formatting.Indented;
|
||||
jsonSerializer.Serialize(textWriter, Object);
|
||||
}
|
||||
|
||||
public static T UnJson<T>(string Path)
|
||||
{
|
||||
using StreamReader reader = File.OpenText(Path);
|
||||
return (T)new JsonSerializer
|
||||
{
|
||||
NullValueHandling = NullValueHandling.Ignore,
|
||||
TypeNameHandling = TypeNameHandling.All
|
||||
}.Deserialize(reader, typeof(T));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,58 +1,59 @@
|
||||
using System;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
public class SoundPlayer
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
//Todo Fix
|
||||
//public MediaPlayer mp = new MediaPlayer();
|
||||
public class SoundPlayer
|
||||
{
|
||||
//Todo Fix
|
||||
//public MediaPlayer mp = new MediaPlayer();
|
||||
|
||||
private bool l;
|
||||
private bool l;
|
||||
|
||||
private TimeSpan ts = new TimeSpan(0L);
|
||||
private TimeSpan ts = new TimeSpan(0L);
|
||||
|
||||
public bool Loop
|
||||
{
|
||||
get
|
||||
{
|
||||
return l;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value)
|
||||
{
|
||||
if (l != value)
|
||||
{
|
||||
//mp.MediaEnded += loop;
|
||||
}
|
||||
}
|
||||
else if (l != value)
|
||||
{
|
||||
//mp.MediaEnded -= loop;
|
||||
}
|
||||
l = value;
|
||||
}
|
||||
}
|
||||
public bool Loop
|
||||
{
|
||||
get
|
||||
{
|
||||
return l;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value)
|
||||
{
|
||||
if (l != value)
|
||||
{
|
||||
//mp.MediaEnded += loop;
|
||||
}
|
||||
}
|
||||
else if (l != value)
|
||||
{
|
||||
//mp.MediaEnded -= loop;
|
||||
}
|
||||
l = value;
|
||||
}
|
||||
}
|
||||
|
||||
public SoundPlayer(string Path, bool Loop)
|
||||
{
|
||||
//mp.Open(new Uri(Path));
|
||||
this.Loop = Loop;
|
||||
//mp.Volume = 1.0;
|
||||
}
|
||||
public SoundPlayer(string Path, bool Loop)
|
||||
{
|
||||
//mp.Open(new Uri(Path));
|
||||
this.Loop = Loop;
|
||||
//mp.Volume = 1.0;
|
||||
}
|
||||
|
||||
public void Play()
|
||||
{
|
||||
//mp.Play();
|
||||
}
|
||||
public void Play()
|
||||
{
|
||||
//mp.Play();
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
{
|
||||
//mp.Stop();
|
||||
}
|
||||
public void Stop()
|
||||
{
|
||||
//mp.Stop();
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
//mp.Close();
|
||||
}
|
||||
public void Close()
|
||||
{
|
||||
//mp.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,167 +1,168 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
public class Swi
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
private bool flag;
|
||||
public class Swi
|
||||
{
|
||||
private bool flag;
|
||||
|
||||
private Color OnColor = Color.Red;
|
||||
private Color OnColor = Color.Red;
|
||||
|
||||
private List<Color> colors;
|
||||
private List<Color> colors;
|
||||
|
||||
public bool Flag => flag;
|
||||
public bool Flag => flag;
|
||||
|
||||
public Swi(Color OnColor)
|
||||
{
|
||||
this.OnColor = OnColor;
|
||||
}
|
||||
public Swi(Color OnColor)
|
||||
{
|
||||
this.OnColor = OnColor;
|
||||
}
|
||||
|
||||
public Swi(ref Color OnColor)
|
||||
{
|
||||
this.OnColor = OnColor;
|
||||
}
|
||||
public Swi(ref Color OnColor)
|
||||
{
|
||||
this.OnColor = OnColor;
|
||||
}
|
||||
|
||||
public void OnOff(But But)
|
||||
{
|
||||
But1 but = (But1)But;
|
||||
if (!flag)
|
||||
{
|
||||
flag = true;
|
||||
if (colors == null)
|
||||
{
|
||||
colors = new List<Color>(but.BaseColors);
|
||||
}
|
||||
int i;
|
||||
for (i = 0; i < but.BaseColors.Count; i++)
|
||||
{
|
||||
but.BaseColors[i] = OnColor;
|
||||
but.OverColors[i] = but.BaseColors[i].FuncHSV(delegate(Hsv hsv)
|
||||
{
|
||||
hsv.Hue += 30;
|
||||
hsv.Sat -= 30;
|
||||
hsv.Val += 100;
|
||||
return hsv;
|
||||
});
|
||||
but.PushColors[i] = but.OverColors[i].FuncHSV(delegate(Hsv hsv)
|
||||
{
|
||||
hsv.Hue += 30;
|
||||
hsv.Sat -= 30;
|
||||
hsv.Val += 100;
|
||||
return hsv;
|
||||
});
|
||||
}
|
||||
i = 0;
|
||||
{
|
||||
foreach (Par item in but.Pars.EnumAllPar())
|
||||
{
|
||||
item.BrushColor = but.OverColors[i];
|
||||
i++;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
flag = false;
|
||||
if (colors != null)
|
||||
{
|
||||
but.BaseColors = colors;
|
||||
colors = null;
|
||||
}
|
||||
int j;
|
||||
for (j = 0; j < but.BaseColors.Count; j++)
|
||||
{
|
||||
but.OverColors[j] = but.BaseColors[j].FuncHSV(delegate(Hsv hsv)
|
||||
{
|
||||
hsv.Hue += 30;
|
||||
hsv.Sat -= 30;
|
||||
hsv.Val += 100;
|
||||
return hsv;
|
||||
});
|
||||
but.PushColors[j] = but.OverColors[j].FuncHSV(delegate(Hsv hsv)
|
||||
{
|
||||
hsv.Hue += 30;
|
||||
hsv.Sat -= 30;
|
||||
hsv.Val += 100;
|
||||
return hsv;
|
||||
});
|
||||
}
|
||||
j = 0;
|
||||
foreach (Par item2 in but.Pars.EnumAllPar())
|
||||
{
|
||||
item2.BrushColor = but.OverColors[j];
|
||||
j++;
|
||||
}
|
||||
}
|
||||
public void OnOff(But But)
|
||||
{
|
||||
But1 but = (But1)But;
|
||||
if (!flag)
|
||||
{
|
||||
flag = true;
|
||||
if (colors == null)
|
||||
{
|
||||
colors = new List<Color>(but.BaseColors);
|
||||
}
|
||||
int i;
|
||||
for (i = 0; i < but.BaseColors.Count; i++)
|
||||
{
|
||||
but.BaseColors[i] = OnColor;
|
||||
but.OverColors[i] = but.BaseColors[i].FuncHSV(delegate(Hsv hsv)
|
||||
{
|
||||
hsv.Hue += 30;
|
||||
hsv.Sat -= 30;
|
||||
hsv.Val += 100;
|
||||
return hsv;
|
||||
});
|
||||
but.PushColors[i] = but.OverColors[i].FuncHSV(delegate(Hsv hsv)
|
||||
{
|
||||
hsv.Hue += 30;
|
||||
hsv.Sat -= 30;
|
||||
hsv.Val += 100;
|
||||
return hsv;
|
||||
});
|
||||
}
|
||||
i = 0;
|
||||
{
|
||||
foreach (Par item in but.Pars.EnumAllPar())
|
||||
{
|
||||
item.BrushColor = but.OverColors[i];
|
||||
i++;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
flag = false;
|
||||
if (colors != null)
|
||||
{
|
||||
but.BaseColors = colors;
|
||||
colors = null;
|
||||
}
|
||||
int j;
|
||||
for (j = 0; j < but.BaseColors.Count; j++)
|
||||
{
|
||||
but.OverColors[j] = but.BaseColors[j].FuncHSV(delegate(Hsv hsv)
|
||||
{
|
||||
hsv.Hue += 30;
|
||||
hsv.Sat -= 30;
|
||||
hsv.Val += 100;
|
||||
return hsv;
|
||||
});
|
||||
but.PushColors[j] = but.OverColors[j].FuncHSV(delegate(Hsv hsv)
|
||||
{
|
||||
hsv.Hue += 30;
|
||||
hsv.Sat -= 30;
|
||||
hsv.Val += 100;
|
||||
return hsv;
|
||||
});
|
||||
}
|
||||
j = 0;
|
||||
foreach (Par item2 in but.Pars.EnumAllPar())
|
||||
{
|
||||
item2.BrushColor = but.OverColors[j];
|
||||
j++;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetFlag(But But, bool On)
|
||||
{
|
||||
But1 but = (But1)But;
|
||||
if (On)
|
||||
{
|
||||
flag = true;
|
||||
if (colors == null)
|
||||
{
|
||||
colors = new List<Color>(but.BaseColors);
|
||||
}
|
||||
int i;
|
||||
for (i = 0; i < but.BaseColors.Count; i++)
|
||||
{
|
||||
but.BaseColors[i] = OnColor;
|
||||
but.OverColors[i] = but.BaseColors[i].FuncHSV(delegate(Hsv hsv)
|
||||
{
|
||||
hsv.Hue += 30;
|
||||
hsv.Sat -= 30;
|
||||
hsv.Val += 100;
|
||||
return hsv;
|
||||
});
|
||||
but.PushColors[i] = but.OverColors[i].FuncHSV(delegate(Hsv hsv)
|
||||
{
|
||||
hsv.Hue += 30;
|
||||
hsv.Sat -= 30;
|
||||
hsv.Val += 100;
|
||||
return hsv;
|
||||
});
|
||||
}
|
||||
i = 0;
|
||||
{
|
||||
foreach (Par item in but.Pars.EnumAllPar())
|
||||
{
|
||||
item.BrushColor = but.BaseColors[i];
|
||||
i++;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
flag = false;
|
||||
if (colors != null)
|
||||
{
|
||||
but.BaseColors = colors;
|
||||
colors = null;
|
||||
}
|
||||
int j;
|
||||
for (j = 0; j < but.BaseColors.Count; j++)
|
||||
{
|
||||
but.OverColors[j] = but.BaseColors[j].FuncHSV(delegate(Hsv hsv)
|
||||
{
|
||||
hsv.Hue += 30;
|
||||
hsv.Sat -= 30;
|
||||
hsv.Val += 100;
|
||||
return hsv;
|
||||
});
|
||||
but.PushColors[j] = but.OverColors[j].FuncHSV(delegate(Hsv hsv)
|
||||
{
|
||||
hsv.Hue += 30;
|
||||
hsv.Sat -= 30;
|
||||
hsv.Val += 100;
|
||||
return hsv;
|
||||
});
|
||||
}
|
||||
j = 0;
|
||||
foreach (Par item2 in but.Pars.EnumAllPar())
|
||||
{
|
||||
item2.BrushColor = but.BaseColors[j];
|
||||
j++;
|
||||
}
|
||||
}
|
||||
public void SetFlag(But But, bool On)
|
||||
{
|
||||
But1 but = (But1)But;
|
||||
if (On)
|
||||
{
|
||||
flag = true;
|
||||
if (colors == null)
|
||||
{
|
||||
colors = new List<Color>(but.BaseColors);
|
||||
}
|
||||
int i;
|
||||
for (i = 0; i < but.BaseColors.Count; i++)
|
||||
{
|
||||
but.BaseColors[i] = OnColor;
|
||||
but.OverColors[i] = but.BaseColors[i].FuncHSV(delegate(Hsv hsv)
|
||||
{
|
||||
hsv.Hue += 30;
|
||||
hsv.Sat -= 30;
|
||||
hsv.Val += 100;
|
||||
return hsv;
|
||||
});
|
||||
but.PushColors[i] = but.OverColors[i].FuncHSV(delegate(Hsv hsv)
|
||||
{
|
||||
hsv.Hue += 30;
|
||||
hsv.Sat -= 30;
|
||||
hsv.Val += 100;
|
||||
return hsv;
|
||||
});
|
||||
}
|
||||
i = 0;
|
||||
{
|
||||
foreach (Par item in but.Pars.EnumAllPar())
|
||||
{
|
||||
item.BrushColor = but.BaseColors[i];
|
||||
i++;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
flag = false;
|
||||
if (colors != null)
|
||||
{
|
||||
but.BaseColors = colors;
|
||||
colors = null;
|
||||
}
|
||||
int j;
|
||||
for (j = 0; j < but.BaseColors.Count; j++)
|
||||
{
|
||||
but.OverColors[j] = but.BaseColors[j].FuncHSV(delegate(Hsv hsv)
|
||||
{
|
||||
hsv.Hue += 30;
|
||||
hsv.Sat -= 30;
|
||||
hsv.Val += 100;
|
||||
return hsv;
|
||||
});
|
||||
but.PushColors[j] = but.OverColors[j].FuncHSV(delegate(Hsv hsv)
|
||||
{
|
||||
hsv.Hue += 30;
|
||||
hsv.Sat -= 30;
|
||||
hsv.Val += 100;
|
||||
return hsv;
|
||||
});
|
||||
}
|
||||
j = 0;
|
||||
foreach (Par item2 in but.Pars.EnumAllPar())
|
||||
{
|
||||
item2.BrushColor = but.BaseColors[j];
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,403 +3,404 @@ using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
public class Tex
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
private Pars pars;
|
||||
public class Tex
|
||||
{
|
||||
private Pars pars;
|
||||
|
||||
private ParT parT;
|
||||
private ParT parT;
|
||||
|
||||
private Par feed;
|
||||
private Par feed;
|
||||
|
||||
public int Space;
|
||||
public int Space;
|
||||
|
||||
private string text;
|
||||
private string text;
|
||||
|
||||
private double speed = 1.0;
|
||||
private double speed = 1.0;
|
||||
|
||||
private Action<Tex> Action = delegate
|
||||
{
|
||||
};
|
||||
private Action<Tex> Action = delegate
|
||||
{
|
||||
};
|
||||
|
||||
private MotV mv;
|
||||
private MotV mv;
|
||||
|
||||
private bool f1;
|
||||
private bool f1;
|
||||
|
||||
private bool f2;
|
||||
private bool f2;
|
||||
|
||||
private double Count;
|
||||
private double Count;
|
||||
|
||||
private int Max;
|
||||
private int Max;
|
||||
|
||||
public Action<Tex> Done;
|
||||
public Action<Tex> Done;
|
||||
|
||||
private byte a0;
|
||||
private byte a0;
|
||||
|
||||
private byte a1;
|
||||
private byte a1;
|
||||
|
||||
private string ConfigPath = Directory.GetCurrentDirectory() + "\\Config.ini";
|
||||
private string ConfigPath = Directory.GetCurrentDirectory() + "\\Config.ini";
|
||||
|
||||
private bool FastText;
|
||||
private bool FastText;
|
||||
|
||||
public Pars Pars => pars;
|
||||
public Pars Pars => pars;
|
||||
|
||||
public ParT ParT => parT;
|
||||
public ParT ParT => parT;
|
||||
|
||||
public Par Feed => feed;
|
||||
public Par Feed => feed;
|
||||
|
||||
public string TextIm
|
||||
{
|
||||
get
|
||||
{
|
||||
return text.Substring(Space, text.Length - Space);
|
||||
}
|
||||
set
|
||||
{
|
||||
if (feed != null)
|
||||
{
|
||||
a0 = feed.BrushColor.A;
|
||||
a1 = feed.PenColor.A;
|
||||
feed.BrushColor = Color.FromArgb(0, feed.BrushColor);
|
||||
feed.PenColor = Color.FromArgb(0, feed.PenColor);
|
||||
}
|
||||
text = new string(' ', Space) + value;
|
||||
Max = text.Length;
|
||||
Count = Max;
|
||||
f1 = false;
|
||||
if (parT != null)
|
||||
{
|
||||
parT.Text = text;
|
||||
}
|
||||
}
|
||||
}
|
||||
public string TextIm
|
||||
{
|
||||
get
|
||||
{
|
||||
return text.Substring(Space, text.Length - Space);
|
||||
}
|
||||
set
|
||||
{
|
||||
if (feed != null)
|
||||
{
|
||||
a0 = feed.BrushColor.A;
|
||||
a1 = feed.PenColor.A;
|
||||
feed.BrushColor = Color.FromArgb(0, feed.BrushColor);
|
||||
feed.PenColor = Color.FromArgb(0, feed.PenColor);
|
||||
}
|
||||
text = new string(' ', Space) + value;
|
||||
Max = text.Length;
|
||||
Count = Max;
|
||||
f1 = false;
|
||||
if (parT != null)
|
||||
{
|
||||
parT.Text = text;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public string Text
|
||||
{
|
||||
get
|
||||
{
|
||||
return text.Substring(Space, text.Length - Space);
|
||||
}
|
||||
set
|
||||
{
|
||||
if (feed != null)
|
||||
{
|
||||
a0 = feed.BrushColor.A;
|
||||
a1 = feed.PenColor.A;
|
||||
feed.BrushColor = Color.FromArgb(0, feed.BrushColor);
|
||||
feed.PenColor = Color.FromArgb(0, feed.PenColor);
|
||||
}
|
||||
text = new string(' ', Space) + value;
|
||||
Max = text.Length;
|
||||
Count = Space;
|
||||
f1 = false;
|
||||
}
|
||||
}
|
||||
public string Text
|
||||
{
|
||||
get
|
||||
{
|
||||
return text.Substring(Space, text.Length - Space);
|
||||
}
|
||||
set
|
||||
{
|
||||
if (feed != null)
|
||||
{
|
||||
a0 = feed.BrushColor.A;
|
||||
a1 = feed.PenColor.A;
|
||||
feed.BrushColor = Color.FromArgb(0, feed.BrushColor);
|
||||
feed.PenColor = Color.FromArgb(0, feed.PenColor);
|
||||
}
|
||||
text = new string(' ', Space) + value;
|
||||
Max = text.Length;
|
||||
Count = Space;
|
||||
f1 = false;
|
||||
}
|
||||
}
|
||||
|
||||
public double Speed
|
||||
{
|
||||
get
|
||||
{
|
||||
return speed;
|
||||
}
|
||||
set
|
||||
{
|
||||
speed = value;
|
||||
}
|
||||
}
|
||||
public double Speed
|
||||
{
|
||||
get
|
||||
{
|
||||
return speed;
|
||||
}
|
||||
set
|
||||
{
|
||||
speed = value;
|
||||
}
|
||||
}
|
||||
|
||||
public Vector2D Position
|
||||
{
|
||||
get
|
||||
{
|
||||
return parT.PositionBase;
|
||||
}
|
||||
set
|
||||
{
|
||||
parT.PositionBase = value;
|
||||
if (feed != null)
|
||||
{
|
||||
feed.PositionBase = parT.ToGlobal(parT.OP[0].ps[2] * 0.95);
|
||||
}
|
||||
}
|
||||
}
|
||||
public Vector2D Position
|
||||
{
|
||||
get
|
||||
{
|
||||
return parT.PositionBase;
|
||||
}
|
||||
set
|
||||
{
|
||||
parT.PositionBase = value;
|
||||
if (feed != null)
|
||||
{
|
||||
feed.PositionBase = parT.ToGlobal(parT.OP[0].ps[2] * 0.95);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsPlaying => !f1;
|
||||
public bool IsPlaying => !f1;
|
||||
|
||||
public Tex(string Name, ref Vector2D Position, double Size, double Width, double Height, Font Font, double TextSize, int Space, string Text, ref Color TextColor, ref Color ShadColor, ref Color BackColor, double Speed, ref Color FeedColor, Action<Tex> Action)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!File.Exists(ConfigPath))
|
||||
{
|
||||
this.Speed = Speed;
|
||||
speed = Speed;
|
||||
}
|
||||
else
|
||||
{
|
||||
string[] source = ConfigPath.ReadLines();
|
||||
FastText = source.First((string s) => s.StartsWith("FastText:")).Last() == '1';
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
this.Speed = Speed;
|
||||
speed = Speed;
|
||||
}
|
||||
if (FastText)
|
||||
{
|
||||
this.Speed = 50.0;
|
||||
speed = 50.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Speed = Speed;
|
||||
speed = Speed;
|
||||
}
|
||||
this.Space = Space;
|
||||
this.Text = Text;
|
||||
this.Action = Action;
|
||||
SetParT(Name, ref Position, Size, Width, Height, Font, TextSize, Text, ref TextColor, ref ShadColor, ref BackColor);
|
||||
SetFeed(Name, Size, ref FeedColor);
|
||||
mv = new MotV(0.0, 255.0);
|
||||
mv.BaseSpeed = 2.0;
|
||||
}
|
||||
public Tex(string Name, ref Vector2D Position, double Size, double Width, double Height, Font Font, double TextSize, int Space, string Text, ref Color TextColor, ref Color ShadColor, ref Color BackColor, double Speed, ref Color FeedColor, Action<Tex> Action)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!File.Exists(ConfigPath))
|
||||
{
|
||||
this.Speed = Speed;
|
||||
speed = Speed;
|
||||
}
|
||||
else
|
||||
{
|
||||
string[] source = ConfigPath.ReadLines();
|
||||
FastText = source.First((string s) => s.StartsWith("FastText:")).Last() == '1';
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
this.Speed = Speed;
|
||||
speed = Speed;
|
||||
}
|
||||
if (FastText)
|
||||
{
|
||||
this.Speed = 50.0;
|
||||
speed = 50.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Speed = Speed;
|
||||
speed = Speed;
|
||||
}
|
||||
this.Space = Space;
|
||||
this.Text = Text;
|
||||
this.Action = Action;
|
||||
SetParT(Name, ref Position, Size, Width, Height, Font, TextSize, Text, ref TextColor, ref ShadColor, ref BackColor);
|
||||
SetFeed(Name, Size, ref FeedColor);
|
||||
mv = new MotV(0.0, 255.0);
|
||||
mv.BaseSpeed = 2.0;
|
||||
}
|
||||
|
||||
public Tex(string Name, Vector2D Position, double Size, double Width, double Height, Font Font, double TextSize, int Space, string Text, Color TextColor, Color ShadColor, Color BackColor, double Speed, Color FeedColor, Action<Tex> Action)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!File.Exists(ConfigPath))
|
||||
{
|
||||
this.Speed = Speed;
|
||||
speed = Speed;
|
||||
}
|
||||
else
|
||||
{
|
||||
string[] source = ConfigPath.ReadLines();
|
||||
FastText = source.First((string s) => s.StartsWith("FastText:")).Last() == '1';
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
this.Speed = Speed;
|
||||
speed = Speed;
|
||||
}
|
||||
if (FastText)
|
||||
{
|
||||
this.Speed = 50.0;
|
||||
speed = 50.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Speed = Speed;
|
||||
speed = Speed;
|
||||
}
|
||||
this.Space = Space;
|
||||
this.Text = Text;
|
||||
this.Action = Action;
|
||||
SetParT(Name, ref Position, Size, Width, Height, Font, TextSize, Text, ref TextColor, ref ShadColor, ref BackColor);
|
||||
SetFeed(Name, Size, ref FeedColor);
|
||||
mv = new MotV(0.0, 255.0);
|
||||
mv.BaseSpeed = 2.0;
|
||||
}
|
||||
public Tex(string Name, Vector2D Position, double Size, double Width, double Height, Font Font, double TextSize, int Space, string Text, Color TextColor, Color ShadColor, Color BackColor, double Speed, Color FeedColor, Action<Tex> Action)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!File.Exists(ConfigPath))
|
||||
{
|
||||
this.Speed = Speed;
|
||||
speed = Speed;
|
||||
}
|
||||
else
|
||||
{
|
||||
string[] source = ConfigPath.ReadLines();
|
||||
FastText = source.First((string s) => s.StartsWith("FastText:")).Last() == '1';
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
this.Speed = Speed;
|
||||
speed = Speed;
|
||||
}
|
||||
if (FastText)
|
||||
{
|
||||
this.Speed = 50.0;
|
||||
speed = 50.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Speed = Speed;
|
||||
speed = Speed;
|
||||
}
|
||||
this.Space = Space;
|
||||
this.Text = Text;
|
||||
this.Action = Action;
|
||||
SetParT(Name, ref Position, Size, Width, Height, Font, TextSize, Text, ref TextColor, ref ShadColor, ref BackColor);
|
||||
SetFeed(Name, Size, ref FeedColor);
|
||||
mv = new MotV(0.0, 255.0);
|
||||
mv.BaseSpeed = 2.0;
|
||||
}
|
||||
|
||||
public Tex(string Name, ref Vector2D Position, double Size, double Width, double Height, Font Font, double TextSize, int Space, string Text, ref Color TextColor, ref Color ShadColor, ref Color BackColor, double Speed)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!File.Exists(ConfigPath))
|
||||
{
|
||||
this.Speed = Speed;
|
||||
speed = Speed;
|
||||
}
|
||||
else
|
||||
{
|
||||
string[] source = ConfigPath.ReadLines();
|
||||
FastText = source.First((string s) => s.StartsWith("FastText:")).Last() == '1';
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
this.Speed = Speed;
|
||||
speed = Speed;
|
||||
}
|
||||
if (FastText)
|
||||
{
|
||||
this.Speed = 50.0;
|
||||
speed = 50.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Speed = Speed;
|
||||
speed = Speed;
|
||||
}
|
||||
this.Space = Space;
|
||||
this.Text = Text;
|
||||
SetParT(Name, ref Position, Size, Width, Height, Font, TextSize, Text, ref TextColor, ref ShadColor, ref BackColor);
|
||||
}
|
||||
public Tex(string Name, ref Vector2D Position, double Size, double Width, double Height, Font Font, double TextSize, int Space, string Text, ref Color TextColor, ref Color ShadColor, ref Color BackColor, double Speed)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!File.Exists(ConfigPath))
|
||||
{
|
||||
this.Speed = Speed;
|
||||
speed = Speed;
|
||||
}
|
||||
else
|
||||
{
|
||||
string[] source = ConfigPath.ReadLines();
|
||||
FastText = source.First((string s) => s.StartsWith("FastText:")).Last() == '1';
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
this.Speed = Speed;
|
||||
speed = Speed;
|
||||
}
|
||||
if (FastText)
|
||||
{
|
||||
this.Speed = 50.0;
|
||||
speed = 50.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Speed = Speed;
|
||||
speed = Speed;
|
||||
}
|
||||
this.Space = Space;
|
||||
this.Text = Text;
|
||||
SetParT(Name, ref Position, Size, Width, Height, Font, TextSize, Text, ref TextColor, ref ShadColor, ref BackColor);
|
||||
}
|
||||
|
||||
public Tex(string Name, Vector2D Position, double Size, double Width, double Height, Font Font, double TextSize, int Space, string Text, Color TextColor, Color ShadColor, Color BackColor, double Speed)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!File.Exists(ConfigPath))
|
||||
{
|
||||
this.Speed = Speed;
|
||||
speed = Speed;
|
||||
}
|
||||
else
|
||||
{
|
||||
string[] source = ConfigPath.ReadLines();
|
||||
FastText = source.First((string s) => s.StartsWith("FastText:")).Last() == '1';
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
this.Speed = Speed;
|
||||
speed = Speed;
|
||||
}
|
||||
if (FastText)
|
||||
{
|
||||
this.Speed = 50.0;
|
||||
speed = 50.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Speed = Speed;
|
||||
speed = Speed;
|
||||
}
|
||||
this.Space = Space;
|
||||
this.Text = Text;
|
||||
SetParT(Name, ref Position, Size, Width, Height, Font, TextSize, Text, ref TextColor, ref ShadColor, ref BackColor);
|
||||
}
|
||||
public Tex(string Name, Vector2D Position, double Size, double Width, double Height, Font Font, double TextSize, int Space, string Text, Color TextColor, Color ShadColor, Color BackColor, double Speed)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!File.Exists(ConfigPath))
|
||||
{
|
||||
this.Speed = Speed;
|
||||
speed = Speed;
|
||||
}
|
||||
else
|
||||
{
|
||||
string[] source = ConfigPath.ReadLines();
|
||||
FastText = source.First((string s) => s.StartsWith("FastText:")).Last() == '1';
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
this.Speed = Speed;
|
||||
speed = Speed;
|
||||
}
|
||||
if (FastText)
|
||||
{
|
||||
this.Speed = 50.0;
|
||||
speed = 50.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Speed = Speed;
|
||||
speed = Speed;
|
||||
}
|
||||
this.Space = Space;
|
||||
this.Text = Text;
|
||||
SetParT(Name, ref Position, Size, Width, Height, Font, TextSize, Text, ref TextColor, ref ShadColor, ref BackColor);
|
||||
}
|
||||
|
||||
private void SetParT(string Name, ref Vector2D Position, double Size, double Width, double Height, Font Font, double TextSize, string Text, ref Color TextColor, ref Color ShadColor, ref Color BackColor)
|
||||
{
|
||||
pars = new Pars();
|
||||
Out[] array = new Out[1] { Shas.Get正方形() };
|
||||
array.OutlineFalse();
|
||||
parT = new ParT
|
||||
{
|
||||
Tag = Name,
|
||||
InitializeOP = array,
|
||||
PositionBase = Position,
|
||||
SizeBase = Size,
|
||||
Closed = true,
|
||||
BrushColor = BackColor,
|
||||
Font = Font,
|
||||
FontSize = TextSize,
|
||||
TextColor = TextColor,
|
||||
RectSize = new Vector2D(Width, Height),
|
||||
Text = Text
|
||||
};
|
||||
ParT.OP.ScalingX(ParT.BasePointBase, Width);
|
||||
ParT.OP.ScalingY(ParT.BasePointBase, Height);
|
||||
if (ShadColor != Color.Empty)
|
||||
{
|
||||
parT.ShadBrush = new SolidBrush(ShadColor);
|
||||
}
|
||||
pars.Add(parT.Tag, parT);
|
||||
}
|
||||
private void SetParT(string Name, ref Vector2D Position, double Size, double Width, double Height, Font Font, double TextSize, string Text, ref Color TextColor, ref Color ShadColor, ref Color BackColor)
|
||||
{
|
||||
pars = new Pars();
|
||||
Out[] array = new Out[1] { Shas.Get正方形() };
|
||||
array.OutlineFalse();
|
||||
parT = new ParT
|
||||
{
|
||||
Tag = Name,
|
||||
InitializeOP = array,
|
||||
PositionBase = Position,
|
||||
SizeBase = Size,
|
||||
Closed = true,
|
||||
BrushColor = BackColor,
|
||||
Font = Font,
|
||||
FontSize = TextSize,
|
||||
TextColor = TextColor,
|
||||
RectSize = new Vector2D(Width, Height),
|
||||
Text = Text
|
||||
};
|
||||
ParT.OP.ScalingX(ParT.BasePointBase, Width);
|
||||
ParT.OP.ScalingY(ParT.BasePointBase, Height);
|
||||
if (ShadColor != Color.Empty)
|
||||
{
|
||||
parT.ShadBrush = new SolidBrush(ShadColor);
|
||||
}
|
||||
pars.Add(parT.Tag, parT);
|
||||
}
|
||||
|
||||
private void SetFeed(string Name, double Size, ref Color FeedColor)
|
||||
{
|
||||
Out[] array = new Out[1] { Shas.Get三角形() };
|
||||
feed = new Par
|
||||
{
|
||||
Tag = Name + "_Feed",
|
||||
InitializeOP = array,
|
||||
BasePointBase = array.GetCenter(),
|
||||
PositionBase = parT.ToGlobal(parT.OP[0].ps[2] * 0.96),
|
||||
SizeBase = Size * 0.07,
|
||||
SizeYBase = 0.9,
|
||||
Closed = true,
|
||||
PenColor = Color.FromArgb(0, Color.Black),
|
||||
BrushColor = Color.FromArgb(0, FeedColor),
|
||||
Hit = false
|
||||
};
|
||||
feed.OP.ReverseY(feed.BasePointBase);
|
||||
pars.Add(feed.Tag, feed);
|
||||
}
|
||||
private void SetFeed(string Name, double Size, ref Color FeedColor)
|
||||
{
|
||||
Out[] array = new Out[1] { Shas.Get三角形() };
|
||||
feed = new Par
|
||||
{
|
||||
Tag = Name + "_Feed",
|
||||
InitializeOP = array,
|
||||
BasePointBase = array.GetCenter(),
|
||||
PositionBase = parT.ToGlobal(parT.OP[0].ps[2] * 0.96),
|
||||
SizeBase = Size * 0.07,
|
||||
SizeYBase = 0.9,
|
||||
Closed = true,
|
||||
PenColor = Color.FromArgb(0, Color.Black),
|
||||
BrushColor = Color.FromArgb(0, FeedColor),
|
||||
Hit = false
|
||||
};
|
||||
feed.OP.ReverseY(feed.BasePointBase);
|
||||
pars.Add(feed.Tag, feed);
|
||||
}
|
||||
|
||||
public void SetHitColor(Med Med)
|
||||
{
|
||||
if (parT.HitColor != Color.Transparent)
|
||||
{
|
||||
Med.RemUniqueColor(parT.HitColor);
|
||||
}
|
||||
parT.HitColor = Med.GetUniqueColor();
|
||||
}
|
||||
public void SetHitColor(Med Med)
|
||||
{
|
||||
if (parT.HitColor != Color.Transparent)
|
||||
{
|
||||
Med.RemUniqueColor(parT.HitColor);
|
||||
}
|
||||
parT.HitColor = Med.GetUniqueColor();
|
||||
}
|
||||
|
||||
public void Progression(FPS FPS)
|
||||
{
|
||||
if (!f1)
|
||||
{
|
||||
Count += Speed / FPS.Value;
|
||||
int num = (int)Count;
|
||||
if (num <= Max)
|
||||
{
|
||||
parT.Text = text.Substring(0, num);
|
||||
return;
|
||||
}
|
||||
parT.Text = text;
|
||||
f1 = true;
|
||||
if (feed != null)
|
||||
{
|
||||
feed.BrushColor = Color.FromArgb(a0, feed.BrushColor);
|
||||
feed.PenColor = Color.FromArgb(a1, feed.PenColor);
|
||||
}
|
||||
if (Done != null)
|
||||
{
|
||||
Done(this);
|
||||
Done = null;
|
||||
}
|
||||
}
|
||||
else if (feed != null && feed.Dra)
|
||||
{
|
||||
mv.GetValue(FPS);
|
||||
feed.BrushColor = Color.FromArgb((int)mv.Value, feed.BrushColor);
|
||||
feed.PenColor = Color.FromArgb(feed.BrushColor.A, feed.PenColor);
|
||||
}
|
||||
}
|
||||
public void Progression(FPS FPS)
|
||||
{
|
||||
if (!f1)
|
||||
{
|
||||
Count += Speed / FPS.Value;
|
||||
int num = (int)Count;
|
||||
if (num <= Max)
|
||||
{
|
||||
parT.Text = text.Substring(0, num);
|
||||
return;
|
||||
}
|
||||
parT.Text = text;
|
||||
f1 = true;
|
||||
if (feed != null)
|
||||
{
|
||||
feed.BrushColor = Color.FromArgb(a0, feed.BrushColor);
|
||||
feed.PenColor = Color.FromArgb(a1, feed.PenColor);
|
||||
}
|
||||
if (Done != null)
|
||||
{
|
||||
Done(this);
|
||||
Done = null;
|
||||
}
|
||||
}
|
||||
else if (feed != null && feed.Dra)
|
||||
{
|
||||
mv.GetValue(FPS);
|
||||
feed.BrushColor = Color.FromArgb((int)mv.Value, feed.BrushColor);
|
||||
feed.PenColor = Color.FromArgb(feed.BrushColor.A, feed.PenColor);
|
||||
}
|
||||
}
|
||||
|
||||
public bool Down(ref Color HitColor)
|
||||
{
|
||||
if (parT.HitColor == HitColor)
|
||||
{
|
||||
f2 = true;
|
||||
if (!f1 && Speed == speed)
|
||||
{
|
||||
Speed *= 10.0;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public bool Down(ref Color HitColor)
|
||||
{
|
||||
if (parT.HitColor == HitColor)
|
||||
{
|
||||
f2 = true;
|
||||
if (!f1 && Speed == speed)
|
||||
{
|
||||
Speed *= 10.0;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool Up(ref Color HitColor)
|
||||
{
|
||||
if (f1 && f2 && parT.HitColor == HitColor && Speed == speed)
|
||||
{
|
||||
f1 = false;
|
||||
f2 = false;
|
||||
if (feed != null)
|
||||
{
|
||||
feed.BrushColor = Color.FromArgb(0, feed.BrushColor);
|
||||
feed.PenColor = Color.FromArgb(feed.BrushColor.A, feed.PenColor);
|
||||
mv.ResetValue();
|
||||
}
|
||||
Action(this);
|
||||
return true;
|
||||
}
|
||||
Speed = speed;
|
||||
f2 = false;
|
||||
return false;
|
||||
}
|
||||
public bool Up(ref Color HitColor)
|
||||
{
|
||||
if (f1 && f2 && parT.HitColor == HitColor && Speed == speed)
|
||||
{
|
||||
f1 = false;
|
||||
f2 = false;
|
||||
if (feed != null)
|
||||
{
|
||||
feed.BrushColor = Color.FromArgb(0, feed.BrushColor);
|
||||
feed.PenColor = Color.FromArgb(feed.BrushColor.A, feed.PenColor);
|
||||
mv.ResetValue();
|
||||
}
|
||||
Action(this);
|
||||
return true;
|
||||
}
|
||||
Speed = speed;
|
||||
f2 = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
pars.Dispose();
|
||||
}
|
||||
public void Dispose()
|
||||
{
|
||||
pars.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,27 +1,28 @@
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
public static class Text
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
public static void ToText(this string str, string Path, Encoding Encoding)
|
||||
{
|
||||
using StreamWriter streamWriter = new StreamWriter(Path, append: false, Encoding);
|
||||
streamWriter.Write(str);
|
||||
}
|
||||
public static class Text
|
||||
{
|
||||
public static void ToText(this string str, string Path, Encoding Encoding)
|
||||
{
|
||||
using StreamWriter streamWriter = new StreamWriter(Path, append: false, Encoding);
|
||||
streamWriter.Write(str);
|
||||
}
|
||||
|
||||
public static string FromText(this string Path)
|
||||
{
|
||||
using FileStream fileStream = new FileStream(Path, FileMode.Open, FileAccess.Read);
|
||||
byte[] array = new byte[fileStream.Length];
|
||||
fileStream.Read(array, 0, array.Length);
|
||||
using StreamReader streamReader = new StreamReader(new MemoryStream(array), array.GetEncoding());
|
||||
return streamReader.ReadToEnd();
|
||||
}
|
||||
public static string FromText(this string Path)
|
||||
{
|
||||
using FileStream fileStream = new FileStream(Path, FileMode.Open, FileAccess.Read);
|
||||
byte[] array = new byte[fileStream.Length];
|
||||
fileStream.Read(array, 0, array.Length);
|
||||
using StreamReader streamReader = new StreamReader(new MemoryStream(array), array.GetEncoding());
|
||||
return streamReader.ReadToEnd();
|
||||
}
|
||||
|
||||
public static string[] ReadLines(this string Path)
|
||||
{
|
||||
return Path.FromText().Replace("\r", "").Split('\n');
|
||||
}
|
||||
public static string[] ReadLines(this string Path)
|
||||
{
|
||||
return Path.FromText().Replace("\r", "").Split('\n');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,117 +3,118 @@ using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
public class UI //: Form
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
private Med Med;
|
||||
public class UI //: Form
|
||||
{
|
||||
private Med Med;
|
||||
|
||||
private IContainer components;
|
||||
private IContainer components;
|
||||
|
||||
private GlImage wpfImage1;
|
||||
private GlImage wpfImage1;
|
||||
|
||||
//private System.Windows.Controls.Image hostedComponent1;
|
||||
//private System.Windows.Controls.Image hostedComponent1;
|
||||
|
||||
private string ConfigPath = Directory.GetCurrentDirectory() + "\\Config.ini";
|
||||
private string ConfigPath = Directory.GetCurrentDirectory() + "\\Config.ini";
|
||||
|
||||
private bool BigWindow;
|
||||
private bool BigWindow;
|
||||
|
||||
public UI(Med Med)
|
||||
{
|
||||
this.Med = Med;
|
||||
InitializeComponent();
|
||||
}
|
||||
public UI(Med Med)
|
||||
{
|
||||
this.Med = Med;
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void UI_Load(object sender, EventArgs e)
|
||||
{
|
||||
//base.ClientSize =
|
||||
Med.Setting(wpfImage1);
|
||||
//base.ClientSize = new Size(1024, 768);
|
||||
try
|
||||
{
|
||||
if (!File.Exists(ConfigPath))
|
||||
{
|
||||
BigWindow = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
string[] source = ConfigPath.ReadLines();
|
||||
BigWindow = source.First((string s) => s.StartsWith("BigWindow:")).Last() == '1';
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
BigWindow = false;
|
||||
}
|
||||
if (BigWindow)
|
||||
{
|
||||
//base.ClientSize = new Size(1280, 960);
|
||||
}
|
||||
UI_Resize(null, null);
|
||||
}
|
||||
private void UI_Load(object sender, EventArgs e)
|
||||
{
|
||||
//base.ClientSize =
|
||||
Med.Setting(wpfImage1);
|
||||
//base.ClientSize = new Size(1024, 768);
|
||||
try
|
||||
{
|
||||
if (!File.Exists(ConfigPath))
|
||||
{
|
||||
BigWindow = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
string[] source = ConfigPath.ReadLines();
|
||||
BigWindow = source.First((string s) => s.StartsWith("BigWindow:")).Last() == '1';
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
BigWindow = false;
|
||||
}
|
||||
if (BigWindow)
|
||||
{
|
||||
//base.ClientSize = new Size(1280, 960);
|
||||
}
|
||||
UI_Resize(null, null);
|
||||
}
|
||||
|
||||
private void UI_FormClosing()
|
||||
{
|
||||
Med.Drive = false;
|
||||
}
|
||||
private void UI_FormClosing()
|
||||
{
|
||||
Med.Drive = false;
|
||||
}
|
||||
|
||||
private void UI_Resize(object sender, EventArgs e)
|
||||
{
|
||||
//wpfImage1.ImageSetting();
|
||||
//wpfImage1.Image.Width = (double)base.ClientSize.Width * Med.DpiX;
|
||||
//wpfImage1.Image.Height = (double)base.ClientSize.Height * Med.DpiY;
|
||||
}
|
||||
private void UI_Resize(object sender, EventArgs e)
|
||||
{
|
||||
//wpfImage1.ImageSetting();
|
||||
//wpfImage1.Image.Width = (double)base.ClientSize.Width * Med.DpiX;
|
||||
//wpfImage1.Image.Height = (double)base.ClientSize.Height * Med.DpiY;
|
||||
}
|
||||
|
||||
/*
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && components != null)
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}*/
|
||||
/*
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && components != null)
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}*/
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(_2DGAMELIB.UI));
|
||||
this.wpfImage1 = new GlImage();
|
||||
//this.hostedComponent1 = new System.Windows.Controls.Image();
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(_2DGAMELIB.UI));
|
||||
this.wpfImage1 = new GlImage();
|
||||
//this.hostedComponent1 = new System.Windows.Controls.Image();
|
||||
|
||||
//base.SuspendLayout();
|
||||
//base.SuspendLayout();
|
||||
|
||||
/*
|
||||
this.wpfImage1.BackColor = System.Drawing.Color.Black;
|
||||
this.wpfImage1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.wpfImage1.ImeMode = System.Windows.Forms.ImeMode.NoControl;
|
||||
this.wpfImage1.Location = new System.Drawing.Point(0, 0);
|
||||
this.wpfImage1.Name = "wpfImage1";
|
||||
this.wpfImage1.Text = "wpfImage1";
|
||||
this.wpfImage1.TabIndex = 0;
|
||||
this.wpfImage1.Child = this.hostedComponent1;*/
|
||||
/*
|
||||
this.wpfImage1.BackColor = System.Drawing.Color.Black;
|
||||
this.wpfImage1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.wpfImage1.ImeMode = System.Windows.Forms.ImeMode.NoControl;
|
||||
this.wpfImage1.Location = new System.Drawing.Point(0, 0);
|
||||
this.wpfImage1.Name = "wpfImage1";
|
||||
this.wpfImage1.Text = "wpfImage1";
|
||||
this.wpfImage1.TabIndex = 0;
|
||||
this.wpfImage1.Child = this.hostedComponent1;*/
|
||||
|
||||
//this.Text = "UI";
|
||||
//this.Text = "UI";
|
||||
|
||||
//base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 12f);
|
||||
//base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
//base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 12f);
|
||||
//base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
|
||||
//base.Controls.Add(this.wpfImage1);
|
||||
//base.Controls.Add(this.wpfImage1);
|
||||
|
||||
//base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Sizable;
|
||||
//base.Icon = (System.Drawing.Icon)resources.GetObject("$this.Icon");
|
||||
//base.Name = "UI";
|
||||
//base.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
|
||||
//base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Sizable;
|
||||
//base.Icon = (System.Drawing.Icon)resources.GetObject("$this.Icon");
|
||||
//base.Name = "UI";
|
||||
//base.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
|
||||
|
||||
//base.FormClosing += new System.Windows.Forms.FormClosingEventHandler(UI_FormClosing);
|
||||
//base.FormClosing += new System.Windows.Forms.FormClosingEventHandler(UI_FormClosing);
|
||||
|
||||
//beauty
|
||||
this.wpfImage1.Closing = delegate () { UI_FormClosing(); };
|
||||
//beauty
|
||||
this.wpfImage1.Closing = delegate () { UI_FormClosing(); };
|
||||
|
||||
//TODO fix?
|
||||
//base.Load += new System.EventHandler(UI_Load);
|
||||
UI_Load(null, null);
|
||||
//base.Resize += new System.EventHandler(UI_Resize);
|
||||
//base.ResumeLayout(false);
|
||||
}
|
||||
//TODO fix?
|
||||
//base.Load += new System.EventHandler(UI_Load);
|
||||
UI_Load(null, null);
|
||||
//base.Resize += new System.EventHandler(UI_Resize);
|
||||
//base.ResumeLayout(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,67 +1,68 @@
|
||||
using System;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
public static class Vec
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
public static class Vec
|
||||
{
|
||||
|
||||
public static void Add(ref Vector2D v1, ref Vector2D v2, out Vector2D r)
|
||||
{
|
||||
r.X = v1.X + v2.X;
|
||||
r.Y = v1.Y + v2.Y;
|
||||
}
|
||||
public static void Add(ref Vector2D v1, ref Vector2D v2, out Vector2D r)
|
||||
{
|
||||
r.X = v1.X + v2.X;
|
||||
r.Y = v1.Y + v2.Y;
|
||||
}
|
||||
|
||||
public static void Subtract(ref Vector2D v1, ref Vector2D v2, out Vector2D r)
|
||||
{
|
||||
r.X = v1.X - v2.X;
|
||||
r.Y = v1.Y - v2.Y;
|
||||
}
|
||||
public static void Subtract(ref Vector2D v1, ref Vector2D v2, out Vector2D r)
|
||||
{
|
||||
r.X = v1.X - v2.X;
|
||||
r.Y = v1.Y - v2.Y;
|
||||
}
|
||||
|
||||
public static double DistanceSquared(this Vector2D v1, Vector2D v2)
|
||||
{
|
||||
double num = v1.X - v2.X;
|
||||
double num2 = v1.Y - v2.Y;
|
||||
return num * num + num2 * num2;
|
||||
}
|
||||
public static double DistanceSquared(this Vector2D v1, Vector2D v2)
|
||||
{
|
||||
double num = v1.X - v2.X;
|
||||
double num2 = v1.Y - v2.Y;
|
||||
return num * num + num2 * num2;
|
||||
}
|
||||
|
||||
public static void Dot(ref Vector2D v1, ref Vector2D v2, out double r)
|
||||
{
|
||||
r = v1.X * v2.X + v1.Y * v2.Y;
|
||||
}
|
||||
public static void Dot(ref Vector2D v1, ref Vector2D v2, out double r)
|
||||
{
|
||||
r = v1.X * v2.X + v1.Y * v2.Y;
|
||||
}
|
||||
|
||||
public static double Cross(ref Vector2D v1, ref Vector2D v2)
|
||||
{
|
||||
return v1.X * v2.Y - v1.Y * v2.X;
|
||||
}
|
||||
public static double Cross(ref Vector2D v1, ref Vector2D v2)
|
||||
{
|
||||
return v1.X * v2.Y - v1.Y * v2.X;
|
||||
}
|
||||
|
||||
public static Vector2D newNormalize(this Vector2D vector)
|
||||
{
|
||||
vector.Normalize();
|
||||
return vector;
|
||||
}
|
||||
public static Vector2D newNormalize(this Vector2D vector)
|
||||
{
|
||||
vector.Normalize();
|
||||
return vector;
|
||||
}
|
||||
|
||||
public static double Angle(ref Vector2D v1, ref Vector2D v2)
|
||||
{
|
||||
Dot(ref v1, ref v2, out var r);
|
||||
r /= v1.Length() * v2.Length();
|
||||
if (r > 1.0)
|
||||
{
|
||||
r = 1.0;
|
||||
}
|
||||
else if (r < -1.0)
|
||||
{
|
||||
r = -1.0;
|
||||
}
|
||||
return System.Math.Acos(r);
|
||||
}
|
||||
public static double Angle(ref Vector2D v1, ref Vector2D v2)
|
||||
{
|
||||
Dot(ref v1, ref v2, out var r);
|
||||
r /= v1.Length() * v2.Length();
|
||||
if (r > 1.0)
|
||||
{
|
||||
r = 1.0;
|
||||
}
|
||||
else if (r < -1.0)
|
||||
{
|
||||
r = -1.0;
|
||||
}
|
||||
return System.Math.Acos(r);
|
||||
}
|
||||
|
||||
public static double Angle02π(this Vector2D v1, Vector2D v2)
|
||||
{
|
||||
double num = Angle(ref v1, ref v2);
|
||||
if (Cross(ref v1, ref v2) < 0.0)
|
||||
{
|
||||
num = System.Math.PI * 2.0 - num;
|
||||
}
|
||||
return num;
|
||||
}
|
||||
public static double Angle02π(this Vector2D v1, Vector2D v2)
|
||||
{
|
||||
double num = Angle(ref v1, ref v2);
|
||||
if (Cross(ref v1, ref v2) < 0.0)
|
||||
{
|
||||
num = System.Math.PI * 2.0 - num;
|
||||
}
|
||||
return num;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,126 +1,127 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
[Serializable]
|
||||
public struct Vector2D
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
public double X;
|
||||
[Serializable]
|
||||
public struct Vector2D
|
||||
{
|
||||
public double X;
|
||||
|
||||
public double Y;
|
||||
public double Y;
|
||||
|
||||
public double this[int index]
|
||||
{
|
||||
get
|
||||
{
|
||||
return index switch
|
||||
{
|
||||
0 => X,
|
||||
1 => Y,
|
||||
_ => throw new ArgumentOutOfRangeException("index", "Indices for Vector2D run from 0 to 1, inclusive."),
|
||||
};
|
||||
}
|
||||
set
|
||||
{
|
||||
switch (index)
|
||||
{
|
||||
case 0:
|
||||
X = value;
|
||||
break;
|
||||
case 1:
|
||||
Y = value;
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException("index", "Indices for Vector2D run from 0 to 1, inclusive.");
|
||||
}
|
||||
}
|
||||
}
|
||||
public double this[int index]
|
||||
{
|
||||
get
|
||||
{
|
||||
return index switch
|
||||
{
|
||||
0 => X,
|
||||
1 => Y,
|
||||
_ => throw new ArgumentOutOfRangeException("index", "Indices for Vector2D run from 0 to 1, inclusive."),
|
||||
};
|
||||
}
|
||||
set
|
||||
{
|
||||
switch (index)
|
||||
{
|
||||
case 0:
|
||||
X = value;
|
||||
break;
|
||||
case 1:
|
||||
Y = value;
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException("index", "Indices for Vector2D run from 0 to 1, inclusive.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Vector2D(int value)
|
||||
{
|
||||
X = value;
|
||||
Y = value;
|
||||
}
|
||||
public Vector2D(int value)
|
||||
{
|
||||
X = value;
|
||||
Y = value;
|
||||
}
|
||||
|
||||
public Vector2D(float value)
|
||||
{
|
||||
X = value;
|
||||
Y = value;
|
||||
}
|
||||
public Vector2D(float value)
|
||||
{
|
||||
X = value;
|
||||
Y = value;
|
||||
}
|
||||
|
||||
public Vector2D(double value)
|
||||
{
|
||||
X = value;
|
||||
Y = value;
|
||||
}
|
||||
public Vector2D(double value)
|
||||
{
|
||||
X = value;
|
||||
Y = value;
|
||||
}
|
||||
|
||||
public Vector2D(int x, int y)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
}
|
||||
public Vector2D(int x, int y)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
}
|
||||
|
||||
public Vector2D(float x, float y)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
}
|
||||
public Vector2D(float x, float y)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
}
|
||||
|
||||
public Vector2D(double x, double y)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
}
|
||||
public Vector2D(double x, double y)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
}
|
||||
|
||||
public double Length()
|
||||
{
|
||||
return System.Math.Sqrt(X * X + Y * Y);
|
||||
}
|
||||
public double Length()
|
||||
{
|
||||
return System.Math.Sqrt(X * X + Y * Y);
|
||||
}
|
||||
|
||||
public double LengthSquared()
|
||||
{
|
||||
return X * X + Y * Y;
|
||||
}
|
||||
public double LengthSquared()
|
||||
{
|
||||
return X * X + Y * Y;
|
||||
}
|
||||
|
||||
public void Normalize()
|
||||
{
|
||||
double num = Length();
|
||||
if (num != 0.0)
|
||||
{
|
||||
double num2 = 1.0 / num;
|
||||
X *= num2;
|
||||
Y *= num2;
|
||||
}
|
||||
}
|
||||
public void Normalize()
|
||||
{
|
||||
double num = Length();
|
||||
if (num != 0.0)
|
||||
{
|
||||
double num2 = 1.0 / num;
|
||||
X *= num2;
|
||||
Y *= num2;
|
||||
}
|
||||
}
|
||||
|
||||
public static Vector2D operator +(Vector2D left, Vector2D right)
|
||||
{
|
||||
return new Vector2D(left.X + right.X, left.Y + right.Y);
|
||||
}
|
||||
public static Vector2D operator +(Vector2D left, Vector2D right)
|
||||
{
|
||||
return new Vector2D(left.X + right.X, left.Y + right.Y);
|
||||
}
|
||||
|
||||
public static Vector2D operator -(Vector2D left, Vector2D right)
|
||||
{
|
||||
return new Vector2D(left.X - right.X, left.Y - right.Y);
|
||||
}
|
||||
public static Vector2D operator -(Vector2D left, Vector2D right)
|
||||
{
|
||||
return new Vector2D(left.X - right.X, left.Y - right.Y);
|
||||
}
|
||||
|
||||
public static Vector2D operator -(Vector2D value)
|
||||
{
|
||||
return new Vector2D(0.0 - value.X, 0.0 - value.Y);
|
||||
}
|
||||
public static Vector2D operator -(Vector2D value)
|
||||
{
|
||||
return new Vector2D(0.0 - value.X, 0.0 - value.Y);
|
||||
}
|
||||
|
||||
public static Vector2D operator *(Vector2D value, double scale)
|
||||
{
|
||||
return new Vector2D(value.X * scale, value.Y * scale);
|
||||
}
|
||||
public static Vector2D operator *(Vector2D value, double scale)
|
||||
{
|
||||
return new Vector2D(value.X * scale, value.Y * scale);
|
||||
}
|
||||
|
||||
public static Vector2D operator *(double scale, Vector2D value)
|
||||
{
|
||||
return new Vector2D(value.X * scale, value.Y * scale);
|
||||
}
|
||||
public static Vector2D operator *(double scale, Vector2D value)
|
||||
{
|
||||
return new Vector2D(value.X * scale, value.Y * scale);
|
||||
}
|
||||
|
||||
public static Vector2D operator /(Vector2D value, double scale)
|
||||
{
|
||||
return new Vector2D(value.X / scale, value.Y / scale);
|
||||
}
|
||||
public static Vector2D operator /(Vector2D value, double scale)
|
||||
{
|
||||
return new Vector2D(value.X / scale, value.Y / scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,23 +1,24 @@
|
||||
using System;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
[Serializable]
|
||||
public struct Vector2D_2
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
public Vector2D v1;
|
||||
[Serializable]
|
||||
public struct Vector2D_2
|
||||
{
|
||||
public Vector2D v1;
|
||||
|
||||
public Vector2D v2;
|
||||
public Vector2D v2;
|
||||
|
||||
public Vector2D_2(Vector2D v1, Vector2D v2)
|
||||
{
|
||||
this.v1 = v1;
|
||||
this.v2 = v2;
|
||||
}
|
||||
public Vector2D_2(Vector2D v1, Vector2D v2)
|
||||
{
|
||||
this.v1 = v1;
|
||||
this.v2 = v2;
|
||||
}
|
||||
|
||||
public Vector2D_2(ref Vector2D v1, ref Vector2D v2)
|
||||
{
|
||||
this.v1 = v1;
|
||||
this.v2 = v2;
|
||||
}
|
||||
public Vector2D_2(ref Vector2D v1, ref Vector2D v2)
|
||||
{
|
||||
this.v1 = v1;
|
||||
this.v2 = v2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,189 +1,190 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
[Serializable]
|
||||
public struct Vector3D
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
public double X;
|
||||
[Serializable]
|
||||
public struct Vector3D
|
||||
{
|
||||
public double X;
|
||||
|
||||
public double Y;
|
||||
public double Y;
|
||||
|
||||
public double Z;
|
||||
public double Z;
|
||||
|
||||
public double this[int index]
|
||||
{
|
||||
get
|
||||
{
|
||||
return index switch
|
||||
{
|
||||
0 => X,
|
||||
1 => Y,
|
||||
2 => Z,
|
||||
_ => throw new ArgumentOutOfRangeException("index", "Indices for Vector3D run from 0 to 2, inclusive."),
|
||||
};
|
||||
}
|
||||
set
|
||||
{
|
||||
switch (index)
|
||||
{
|
||||
case 0:
|
||||
X = value;
|
||||
break;
|
||||
case 1:
|
||||
Y = value;
|
||||
break;
|
||||
case 2:
|
||||
Z = value;
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException("index", "Indices for Vector3D run from 0 to 2, inclusive.");
|
||||
}
|
||||
}
|
||||
}
|
||||
public double this[int index]
|
||||
{
|
||||
get
|
||||
{
|
||||
return index switch
|
||||
{
|
||||
0 => X,
|
||||
1 => Y,
|
||||
2 => Z,
|
||||
_ => throw new ArgumentOutOfRangeException("index", "Indices for Vector3D run from 0 to 2, inclusive."),
|
||||
};
|
||||
}
|
||||
set
|
||||
{
|
||||
switch (index)
|
||||
{
|
||||
case 0:
|
||||
X = value;
|
||||
break;
|
||||
case 1:
|
||||
Y = value;
|
||||
break;
|
||||
case 2:
|
||||
Z = value;
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException("index", "Indices for Vector3D run from 0 to 2, inclusive.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Vector3D(double value)
|
||||
{
|
||||
X = value;
|
||||
Y = value;
|
||||
Z = value;
|
||||
}
|
||||
public Vector3D(double value)
|
||||
{
|
||||
X = value;
|
||||
Y = value;
|
||||
Z = value;
|
||||
}
|
||||
|
||||
public Vector3D(Vector2D value, double z)
|
||||
{
|
||||
X = value.X;
|
||||
Y = value.Y;
|
||||
Z = z;
|
||||
}
|
||||
public Vector3D(Vector2D value, double z)
|
||||
{
|
||||
X = value.X;
|
||||
Y = value.Y;
|
||||
Z = z;
|
||||
}
|
||||
|
||||
public Vector3D(ref Vector2D value, double z)
|
||||
{
|
||||
X = value.X;
|
||||
Y = value.Y;
|
||||
Z = z;
|
||||
}
|
||||
public Vector3D(ref Vector2D value, double z)
|
||||
{
|
||||
X = value.X;
|
||||
Y = value.Y;
|
||||
Z = z;
|
||||
}
|
||||
|
||||
public Vector3D(double x, double y, double z)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
Z = z;
|
||||
}
|
||||
public Vector3D(double x, double y, double z)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
Z = z;
|
||||
}
|
||||
|
||||
public double Length()
|
||||
{
|
||||
return System.Math.Sqrt(X * X + Y * Y + Z * Z);
|
||||
}
|
||||
public double Length()
|
||||
{
|
||||
return System.Math.Sqrt(X * X + Y * Y + Z * Z);
|
||||
}
|
||||
|
||||
public double LengthSquared()
|
||||
{
|
||||
return X * X + Y * Y + Z * Z;
|
||||
}
|
||||
public double LengthSquared()
|
||||
{
|
||||
return X * X + Y * Y + Z * Z;
|
||||
}
|
||||
|
||||
public void Normalize()
|
||||
{
|
||||
double num = Length();
|
||||
if (num != 0.0)
|
||||
{
|
||||
double num2 = 1.0 / num;
|
||||
X *= num2;
|
||||
Y *= num2;
|
||||
Z *= num2;
|
||||
}
|
||||
}
|
||||
public void Normalize()
|
||||
{
|
||||
double num = Length();
|
||||
if (num != 0.0)
|
||||
{
|
||||
double num2 = 1.0 / num;
|
||||
X *= num2;
|
||||
Y *= num2;
|
||||
Z *= num2;
|
||||
}
|
||||
}
|
||||
|
||||
public static Vector3D operator +(Vector3D left, Vector3D right)
|
||||
{
|
||||
return new Vector3D(left.X + right.X, left.Y + right.Y, left.Z + right.Z);
|
||||
}
|
||||
public static Vector3D operator +(Vector3D left, Vector3D right)
|
||||
{
|
||||
return new Vector3D(left.X + right.X, left.Y + right.Y, left.Z + right.Z);
|
||||
}
|
||||
|
||||
public static Vector3D operator -(Vector3D left, Vector3D right)
|
||||
{
|
||||
return new Vector3D(left.X - right.X, left.Y - right.Y, left.Z - right.Z);
|
||||
}
|
||||
public static Vector3D operator -(Vector3D left, Vector3D right)
|
||||
{
|
||||
return new Vector3D(left.X - right.X, left.Y - right.Y, left.Z - right.Z);
|
||||
}
|
||||
|
||||
public static Vector3D operator -(Vector3D value)
|
||||
{
|
||||
return new Vector3D(0.0 - value.X, 0.0 - value.Y, 0.0 - value.Z);
|
||||
}
|
||||
public static Vector3D operator -(Vector3D value)
|
||||
{
|
||||
return new Vector3D(0.0 - value.X, 0.0 - value.Y, 0.0 - value.Z);
|
||||
}
|
||||
|
||||
public static Vector3D operator *(Vector3D value, double scale)
|
||||
{
|
||||
return new Vector3D(value.X * scale, value.Y * scale, value.Z * scale);
|
||||
}
|
||||
public static Vector3D operator *(Vector3D value, double scale)
|
||||
{
|
||||
return new Vector3D(value.X * scale, value.Y * scale, value.Z * scale);
|
||||
}
|
||||
|
||||
public static Vector3D operator *(double scale, Vector3D value)
|
||||
{
|
||||
return new Vector3D(value.X * scale, value.Y * scale, value.Z * scale);
|
||||
}
|
||||
public static Vector3D operator *(double scale, Vector3D value)
|
||||
{
|
||||
return new Vector3D(value.X * scale, value.Y * scale, value.Z * scale);
|
||||
}
|
||||
|
||||
public static Vector3D operator /(Vector3D value, double scale)
|
||||
{
|
||||
return new Vector3D(value.X / scale, value.Y / scale, value.Z / scale);
|
||||
}
|
||||
public static Vector3D operator /(Vector3D value, double scale)
|
||||
{
|
||||
return new Vector3D(value.X / scale, value.Y / scale, value.Z / scale);
|
||||
}
|
||||
|
||||
public static bool operator ==(Vector3D left, Vector3D right)
|
||||
{
|
||||
if (left.X == right.X && left.Y == right.Y)
|
||||
{
|
||||
return left.Z == right.Z;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public static bool operator ==(Vector3D left, Vector3D right)
|
||||
{
|
||||
if (left.X == right.X && left.Y == right.Y)
|
||||
{
|
||||
return left.Z == right.Z;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool operator !=(Vector3D left, Vector3D right)
|
||||
{
|
||||
if (left.X == right.X && left.Y == right.Y)
|
||||
{
|
||||
return left.Z != right.Z;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public static bool operator !=(Vector3D left, Vector3D right)
|
||||
{
|
||||
if (left.X == right.X && left.Y == right.Y)
|
||||
{
|
||||
return left.Z != right.Z;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format(CultureInfo.CurrentCulture, "X:{0} Y:{1} Z:{2}", new object[3]
|
||||
{
|
||||
X.ToString(CultureInfo.CurrentCulture),
|
||||
Y.ToString(CultureInfo.CurrentCulture),
|
||||
Z.ToString(CultureInfo.CurrentCulture)
|
||||
});
|
||||
}
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format(CultureInfo.CurrentCulture, "X:{0} Y:{1} Z:{2}", new object[3]
|
||||
{
|
||||
X.ToString(CultureInfo.CurrentCulture),
|
||||
Y.ToString(CultureInfo.CurrentCulture),
|
||||
Z.ToString(CultureInfo.CurrentCulture)
|
||||
});
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return X.GetHashCode() + Y.GetHashCode() + Z.GetHashCode();
|
||||
}
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return X.GetHashCode() + Y.GetHashCode() + Z.GetHashCode();
|
||||
}
|
||||
|
||||
public override bool Equals(object value)
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (value.GetType() != GetType())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return Equals((Vector3D)value);
|
||||
}
|
||||
public override bool Equals(object value)
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (value.GetType() != GetType())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return Equals((Vector3D)value);
|
||||
}
|
||||
|
||||
public bool Equals(Vector3D value)
|
||||
{
|
||||
if (X == value.X && Y == value.Y)
|
||||
{
|
||||
return Z == value.Z;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public bool Equals(Vector3D value)
|
||||
{
|
||||
if (X == value.X && Y == value.Y)
|
||||
{
|
||||
return Z == value.Z;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool Equals(ref Vector3D value)
|
||||
{
|
||||
if (X == value.X && Y == value.Y)
|
||||
{
|
||||
return Z == value.Z;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public bool Equals(ref Vector3D value)
|
||||
{
|
||||
if (X == value.X && Y == value.Y)
|
||||
{
|
||||
return Z == value.Z;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,211 +1,212 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
[Serializable]
|
||||
public struct Vector4D
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
public double X;
|
||||
[Serializable]
|
||||
public struct Vector4D
|
||||
{
|
||||
public double X;
|
||||
|
||||
public double Y;
|
||||
public double Y;
|
||||
|
||||
public double Z;
|
||||
public double Z;
|
||||
|
||||
public double W;
|
||||
public double W;
|
||||
|
||||
public double this[int index]
|
||||
{
|
||||
get
|
||||
{
|
||||
return index switch
|
||||
{
|
||||
0 => X,
|
||||
1 => Y,
|
||||
2 => Z,
|
||||
3 => W,
|
||||
_ => throw new ArgumentOutOfRangeException("index", "Indices for Vector4D run from 0 to 3, inclusive."),
|
||||
};
|
||||
}
|
||||
set
|
||||
{
|
||||
switch (index)
|
||||
{
|
||||
case 0:
|
||||
X = value;
|
||||
break;
|
||||
case 1:
|
||||
Y = value;
|
||||
break;
|
||||
case 2:
|
||||
Z = value;
|
||||
break;
|
||||
case 3:
|
||||
W = value;
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException("index", "Indices for Vector4D run from 0 to 3, inclusive.");
|
||||
}
|
||||
}
|
||||
}
|
||||
public double this[int index]
|
||||
{
|
||||
get
|
||||
{
|
||||
return index switch
|
||||
{
|
||||
0 => X,
|
||||
1 => Y,
|
||||
2 => Z,
|
||||
3 => W,
|
||||
_ => throw new ArgumentOutOfRangeException("index", "Indices for Vector4D run from 0 to 3, inclusive."),
|
||||
};
|
||||
}
|
||||
set
|
||||
{
|
||||
switch (index)
|
||||
{
|
||||
case 0:
|
||||
X = value;
|
||||
break;
|
||||
case 1:
|
||||
Y = value;
|
||||
break;
|
||||
case 2:
|
||||
Z = value;
|
||||
break;
|
||||
case 3:
|
||||
W = value;
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException("index", "Indices for Vector4D run from 0 to 3, inclusive.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Vector4D(double value)
|
||||
{
|
||||
X = value;
|
||||
Y = value;
|
||||
Z = value;
|
||||
W = value;
|
||||
}
|
||||
public Vector4D(double value)
|
||||
{
|
||||
X = value;
|
||||
Y = value;
|
||||
Z = value;
|
||||
W = value;
|
||||
}
|
||||
|
||||
public Vector4D(Vector2D value, double z, double w)
|
||||
{
|
||||
X = value.X;
|
||||
Y = value.Y;
|
||||
Z = z;
|
||||
W = w;
|
||||
}
|
||||
public Vector4D(Vector2D value, double z, double w)
|
||||
{
|
||||
X = value.X;
|
||||
Y = value.Y;
|
||||
Z = z;
|
||||
W = w;
|
||||
}
|
||||
|
||||
public Vector4D(ref Vector2D value, double z, double w)
|
||||
{
|
||||
X = value.X;
|
||||
Y = value.Y;
|
||||
Z = z;
|
||||
W = w;
|
||||
}
|
||||
public Vector4D(ref Vector2D value, double z, double w)
|
||||
{
|
||||
X = value.X;
|
||||
Y = value.Y;
|
||||
Z = z;
|
||||
W = w;
|
||||
}
|
||||
|
||||
public Vector4D(Vector3D value, double w)
|
||||
{
|
||||
X = value.X;
|
||||
Y = value.Y;
|
||||
Z = value.Z;
|
||||
W = w;
|
||||
}
|
||||
public Vector4D(Vector3D value, double w)
|
||||
{
|
||||
X = value.X;
|
||||
Y = value.Y;
|
||||
Z = value.Z;
|
||||
W = w;
|
||||
}
|
||||
|
||||
public Vector4D(ref Vector3D value, double w)
|
||||
{
|
||||
X = value.X;
|
||||
Y = value.Y;
|
||||
Z = value.Z;
|
||||
W = w;
|
||||
}
|
||||
public Vector4D(ref Vector3D value, double w)
|
||||
{
|
||||
X = value.X;
|
||||
Y = value.Y;
|
||||
Z = value.Z;
|
||||
W = w;
|
||||
}
|
||||
|
||||
public Vector4D(double x, double y, double z, double w)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
Z = z;
|
||||
W = w;
|
||||
}
|
||||
public Vector4D(double x, double y, double z, double w)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
Z = z;
|
||||
W = w;
|
||||
}
|
||||
|
||||
public double Length()
|
||||
{
|
||||
return System.Math.Sqrt(X * X + Y * Y + Z * Z + W * W);
|
||||
}
|
||||
public double Length()
|
||||
{
|
||||
return System.Math.Sqrt(X * X + Y * Y + Z * Z + W * W);
|
||||
}
|
||||
|
||||
public double LengthSquared()
|
||||
{
|
||||
return X * X + Y * Y + Z * Z + W * W;
|
||||
}
|
||||
public double LengthSquared()
|
||||
{
|
||||
return X * X + Y * Y + Z * Z + W * W;
|
||||
}
|
||||
|
||||
public void Normalize()
|
||||
{
|
||||
double num = Length();
|
||||
if (num != 0.0)
|
||||
{
|
||||
double num2 = 1.0 / num;
|
||||
X *= num2;
|
||||
Y *= num2;
|
||||
Z *= num2;
|
||||
W *= num2;
|
||||
}
|
||||
}
|
||||
public void Normalize()
|
||||
{
|
||||
double num = Length();
|
||||
if (num != 0.0)
|
||||
{
|
||||
double num2 = 1.0 / num;
|
||||
X *= num2;
|
||||
Y *= num2;
|
||||
Z *= num2;
|
||||
W *= num2;
|
||||
}
|
||||
}
|
||||
|
||||
public static Vector4D operator +(Vector4D left, Vector4D right)
|
||||
{
|
||||
return new Vector4D(left.X + right.X, left.Y + right.Y, left.Z + right.Z, left.W + right.W);
|
||||
}
|
||||
public static Vector4D operator +(Vector4D left, Vector4D right)
|
||||
{
|
||||
return new Vector4D(left.X + right.X, left.Y + right.Y, left.Z + right.Z, left.W + right.W);
|
||||
}
|
||||
|
||||
public static Vector4D operator -(Vector4D left, Vector4D right)
|
||||
{
|
||||
return new Vector4D(left.X - right.X, left.Y - right.Y, left.Z - right.Z, left.W - right.W);
|
||||
}
|
||||
public static Vector4D operator -(Vector4D left, Vector4D right)
|
||||
{
|
||||
return new Vector4D(left.X - right.X, left.Y - right.Y, left.Z - right.Z, left.W - right.W);
|
||||
}
|
||||
|
||||
public static Vector4D operator -(Vector4D value)
|
||||
{
|
||||
return new Vector4D(0.0 - value.X, 0.0 - value.Y, 0.0 - value.Z, 0.0 - value.W);
|
||||
}
|
||||
public static Vector4D operator -(Vector4D value)
|
||||
{
|
||||
return new Vector4D(0.0 - value.X, 0.0 - value.Y, 0.0 - value.Z, 0.0 - value.W);
|
||||
}
|
||||
|
||||
public static Vector4D operator *(Vector4D value, double scale)
|
||||
{
|
||||
return new Vector4D(value.X * scale, value.Y * scale, value.Z * scale, value.W * scale);
|
||||
}
|
||||
public static Vector4D operator *(Vector4D value, double scale)
|
||||
{
|
||||
return new Vector4D(value.X * scale, value.Y * scale, value.Z * scale, value.W * scale);
|
||||
}
|
||||
|
||||
public static Vector4D operator *(double scale, Vector4D value)
|
||||
{
|
||||
return new Vector4D(value.X * scale, value.Y * scale, value.Z * scale, value.W * scale);
|
||||
}
|
||||
public static Vector4D operator *(double scale, Vector4D value)
|
||||
{
|
||||
return new Vector4D(value.X * scale, value.Y * scale, value.Z * scale, value.W * scale);
|
||||
}
|
||||
|
||||
public static Vector4D operator /(Vector4D value, double scale)
|
||||
{
|
||||
return new Vector4D(value.X / scale, value.Y / scale, value.Z / scale, value.W / scale);
|
||||
}
|
||||
public static Vector4D operator /(Vector4D value, double scale)
|
||||
{
|
||||
return new Vector4D(value.X / scale, value.Y / scale, value.Z / scale, value.W / scale);
|
||||
}
|
||||
|
||||
public static bool operator ==(Vector4D left, Vector4D right)
|
||||
{
|
||||
if (left.X == right.X && left.Y == right.Y && left.Z == right.Z)
|
||||
{
|
||||
return left.W == right.W;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public static bool operator ==(Vector4D left, Vector4D right)
|
||||
{
|
||||
if (left.X == right.X && left.Y == right.Y && left.Z == right.Z)
|
||||
{
|
||||
return left.W == right.W;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool operator !=(Vector4D left, Vector4D right)
|
||||
{
|
||||
if (left.X == right.X && left.Y == right.Y && left.Z == right.Z)
|
||||
{
|
||||
return left.W != right.W;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public static bool operator !=(Vector4D left, Vector4D right)
|
||||
{
|
||||
if (left.X == right.X && left.Y == right.Y && left.Z == right.Z)
|
||||
{
|
||||
return left.W != right.W;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format(CultureInfo.CurrentCulture, "X:{0} Y:{1} Z:{2} W:{3}", X.ToString(CultureInfo.CurrentCulture), Y.ToString(CultureInfo.CurrentCulture), Z.ToString(CultureInfo.CurrentCulture), W.ToString(CultureInfo.CurrentCulture));
|
||||
}
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format(CultureInfo.CurrentCulture, "X:{0} Y:{1} Z:{2} W:{3}", X.ToString(CultureInfo.CurrentCulture), Y.ToString(CultureInfo.CurrentCulture), Z.ToString(CultureInfo.CurrentCulture), W.ToString(CultureInfo.CurrentCulture));
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return X.GetHashCode() + Y.GetHashCode() + Z.GetHashCode() + W.GetHashCode();
|
||||
}
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return X.GetHashCode() + Y.GetHashCode() + Z.GetHashCode() + W.GetHashCode();
|
||||
}
|
||||
|
||||
public override bool Equals(object value)
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (value.GetType() != GetType())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return Equals((Vector4D)value);
|
||||
}
|
||||
public override bool Equals(object value)
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (value.GetType() != GetType())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return Equals((Vector4D)value);
|
||||
}
|
||||
|
||||
public bool Equals(Vector4D value)
|
||||
{
|
||||
if (X == value.X && Y == value.Y && Z == value.Z)
|
||||
{
|
||||
return W == value.W;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public bool Equals(Vector4D value)
|
||||
{
|
||||
if (X == value.X && Y == value.Y && Z == value.Z)
|
||||
{
|
||||
return W == value.W;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool Equals(ref Vector4D value)
|
||||
{
|
||||
if (X == value.X && Y == value.Y && Z == value.Z)
|
||||
{
|
||||
return W == value.W;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public bool Equals(ref Vector4D value)
|
||||
{
|
||||
if (X == value.X && Y == value.Y && Z == value.Z)
|
||||
{
|
||||
return W == value.W;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,146 +6,146 @@ using System.Drawing.Imaging;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
public enum MouseButtons {
|
||||
None = 0,
|
||||
Left = 1,
|
||||
Right = 2,
|
||||
Middle = 4,
|
||||
Button4 = 8,
|
||||
Button5 = 16
|
||||
}
|
||||
|
||||
public class GlImage
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
public enum MouseButtons {
|
||||
None = 0,
|
||||
Left = 1,
|
||||
Right = 2,
|
||||
Middle = 4,
|
||||
Button4 = 8,
|
||||
Button5 = 16
|
||||
}
|
||||
|
||||
//yeah this is a little bit sketchy
|
||||
public static unsafe GLFW.Window PtrToWindow(IntPtr source)
|
||||
public class GlImage
|
||||
{
|
||||
var sourceRef = __makeref(source);
|
||||
var dest = default(GLFW.Window);
|
||||
var destRef = __makeref(dest);
|
||||
*(IntPtr*)&destRef = *(IntPtr*)&sourceRef;
|
||||
return __refvalue(destRef, GLFW.Window);
|
||||
}
|
||||
|
||||
public GLFW.Window window;
|
||||
private uint shader_program;
|
||||
private uint texture;
|
||||
private uint vertex_buf;
|
||||
private uint vao;
|
||||
//yeah this is a little bit sketchy
|
||||
public static unsafe GLFW.Window PtrToWindow(IntPtr source)
|
||||
{
|
||||
var sourceRef = __makeref(source);
|
||||
var dest = default(GLFW.Window);
|
||||
var destRef = __makeref(dest);
|
||||
*(IntPtr*)&destRef = *(IntPtr*)&sourceRef;
|
||||
return __refvalue(destRef, GLFW.Window);
|
||||
}
|
||||
|
||||
public GLFW.Window window;
|
||||
private uint shader_program;
|
||||
private uint texture;
|
||||
private uint vertex_buf;
|
||||
private uint vao;
|
||||
|
||||
|
||||
public GlImage() { }
|
||||
public GlImage() { }
|
||||
|
||||
public void ImageSetting() { }
|
||||
public void ImageSetting() { }
|
||||
|
||||
public System.Drawing.Point GetCursorPoint() {
|
||||
double x, y;
|
||||
Glfw.GetCursorPosition(window, out x, out y);
|
||||
return new System.Drawing.Point((int)x, (int)y);
|
||||
}
|
||||
public System.Drawing.Point GetCursorPoint() {
|
||||
double x, y;
|
||||
Glfw.GetCursorPosition(window, out x, out y);
|
||||
return new System.Drawing.Point((int)x, (int)y);
|
||||
}
|
||||
|
||||
public MouseButtons GetMouseButtons() {
|
||||
MouseButtons btns = 0;
|
||||
public MouseButtons GetMouseButtons() {
|
||||
MouseButtons btns = 0;
|
||||
|
||||
if (Glfw.GetMouseButton(window, MouseButton.Left) == InputState.Press)
|
||||
btns |= MouseButtons.Left;
|
||||
if (Glfw.GetMouseButton(window, MouseButton.Left) == InputState.Press)
|
||||
btns |= MouseButtons.Left;
|
||||
|
||||
if (Glfw.GetMouseButton(window, MouseButton.Right) == InputState.Press)
|
||||
btns |= MouseButtons.Right;
|
||||
if (Glfw.GetMouseButton(window, MouseButton.Right) == InputState.Press)
|
||||
btns |= MouseButtons.Right;
|
||||
|
||||
if (Glfw.GetMouseButton(window, MouseButton.Middle) == InputState.Press)
|
||||
btns |= MouseButtons.Middle;
|
||||
if (Glfw.GetMouseButton(window, MouseButton.Middle) == InputState.Press)
|
||||
btns |= MouseButtons.Middle;
|
||||
|
||||
if (Glfw.GetMouseButton(window, MouseButton.Button4) == InputState.Press)
|
||||
btns |= MouseButtons.Button4;
|
||||
if (Glfw.GetMouseButton(window, MouseButton.Button4) == InputState.Press)
|
||||
btns |= MouseButtons.Button4;
|
||||
|
||||
if (Glfw.GetMouseButton(window, MouseButton.Button5) == InputState.Press)
|
||||
btns |= MouseButtons.Button5;
|
||||
if (Glfw.GetMouseButton(window, MouseButton.Button5) == InputState.Press)
|
||||
btns |= MouseButtons.Button5;
|
||||
|
||||
return btns;
|
||||
}
|
||||
return btns;
|
||||
}
|
||||
|
||||
public delegate void ShouldCloseCallback();
|
||||
public delegate void ShouldCloseCallback();
|
||||
|
||||
public ShouldCloseCallback Closing = delegate () { };
|
||||
public MouseButtonCallback Click = delegate (IntPtr window, MouseButton button, InputState state, ModifierKeys modifiers) { };
|
||||
public MouseCallback Move = delegate (IntPtr window, double x, double y) { };
|
||||
public SizeCallback Resize = delegate (IntPtr window, int width, int height) { };
|
||||
public MouseCallback Scroll = delegate (IntPtr window, double x, double y) { };
|
||||
public MouseEnterCallback Leave = delegate (IntPtr window, bool entered) { };
|
||||
public ShouldCloseCallback Closing = delegate () { };
|
||||
public MouseButtonCallback Click = delegate (IntPtr window, MouseButton button, InputState state, ModifierKeys modifiers) { };
|
||||
public MouseCallback Move = delegate (IntPtr window, double x, double y) { };
|
||||
public SizeCallback Resize = delegate (IntPtr window, int width, int height) { };
|
||||
public MouseCallback Scroll = delegate (IntPtr window, double x, double y) { };
|
||||
public MouseEnterCallback Leave = delegate (IntPtr window, bool entered) { };
|
||||
|
||||
public void SetTitle(string title) {
|
||||
Glfw.SetWindowTitle(window, title);
|
||||
}
|
||||
public void SetTitle(string title) {
|
||||
Glfw.SetWindowTitle(window, title);
|
||||
}
|
||||
|
||||
public void PollEvents() {
|
||||
Glfw.PollEvents();
|
||||
if (Glfw.WindowShouldClose(window))
|
||||
Closing();
|
||||
}
|
||||
public void SetBitmap(Bitmap bmp)
|
||||
{
|
||||
Gl.UseProgram(shader_program);
|
||||
Gl.Viewport(0, 0, bmp.Width, bmp.Height);
|
||||
public void PollEvents() {
|
||||
Glfw.PollEvents();
|
||||
if (Glfw.WindowShouldClose(window))
|
||||
Closing();
|
||||
}
|
||||
public void SetBitmap(Bitmap bmp)
|
||||
{
|
||||
Gl.UseProgram(shader_program);
|
||||
Gl.Viewport(0, 0, bmp.Width, bmp.Height);
|
||||
|
||||
Gl.ActiveTexture(TextureUnit.Texture0);
|
||||
Gl.BindTexture(TextureTarget.Texture2d, texture);
|
||||
Gl.ActiveTexture(TextureUnit.Texture0);
|
||||
Gl.BindTexture(TextureTarget.Texture2d, texture);
|
||||
|
||||
BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
|
||||
Gl.TexImage2D(TextureTarget.Texture2d, 0, InternalFormat.Rgba8, bmp.Width, bmp.Height, 0, OpenGL.PixelFormat.Bgra, PixelType.UnsignedByte, data.Scan0);
|
||||
bmp.UnlockBits(data);
|
||||
BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
|
||||
Gl.TexImage2D(TextureTarget.Texture2d, 0, InternalFormat.Rgba8, bmp.Width, bmp.Height, 0, OpenGL.PixelFormat.Bgra, PixelType.UnsignedByte, data.Scan0);
|
||||
bmp.UnlockBits(data);
|
||||
|
||||
int res_pos = Gl.GetUniformLocation(shader_program, "res");
|
||||
Gl.Uniform2(res_pos, (float)bmp.Width, (float)bmp.Height);
|
||||
int res_pos = Gl.GetUniformLocation(shader_program, "res");
|
||||
Gl.Uniform2(res_pos, (float)bmp.Width, (float)bmp.Height);
|
||||
|
||||
Gl.BindBuffer(BufferTarget.ArrayBuffer, vertex_buf);
|
||||
uint vert_pos = (uint)Gl.GetAttribLocation(shader_program, "vertPos");
|
||||
Gl.EnableVertexAttribArray(vert_pos);
|
||||
Gl.BindBuffer(BufferTarget.ArrayBuffer, vertex_buf);
|
||||
uint vert_pos = (uint)Gl.GetAttribLocation(shader_program, "vertPos");
|
||||
Gl.EnableVertexAttribArray(vert_pos);
|
||||
|
||||
Gl.BindVertexArray(vao);
|
||||
Gl.VertexAttribPointer(
|
||||
vert_pos,
|
||||
2,
|
||||
VertexAttribType.Float,
|
||||
false,
|
||||
0,
|
||||
IntPtr.Zero
|
||||
);
|
||||
Gl.BindVertexArray(vao);
|
||||
Gl.VertexAttribPointer(
|
||||
vert_pos,
|
||||
2,
|
||||
VertexAttribType.Float,
|
||||
false,
|
||||
0,
|
||||
IntPtr.Zero
|
||||
);
|
||||
|
||||
Gl.DrawArrays(PrimitiveType.TriangleStrip, 0, 4);
|
||||
Glfw.SwapBuffers(window);
|
||||
}
|
||||
Gl.DrawArrays(PrimitiveType.TriangleStrip, 0, 4);
|
||||
Glfw.SwapBuffers(window);
|
||||
}
|
||||
|
||||
public void BitmapSetting(Bitmap bmp)
|
||||
{
|
||||
Glfw.WindowHint(Hint.ClientApi, ClientApi.OpenGL);
|
||||
Glfw.WindowHint(Hint.ContextVersionMajor, 3);
|
||||
Glfw.WindowHint(Hint.ContextVersionMinor, 3);
|
||||
Glfw.WindowHint(Hint.OpenglProfile, Profile.Core);
|
||||
Glfw.WindowHint(Hint.Doublebuffer, true);
|
||||
Glfw.WindowHint(Hint.Decorated, true);
|
||||
Glfw.WindowHint(Hint.OpenglForwardCompatible, true);
|
||||
public void BitmapSetting(Bitmap bmp)
|
||||
{
|
||||
Glfw.WindowHint(Hint.ClientApi, ClientApi.OpenGL);
|
||||
Glfw.WindowHint(Hint.ContextVersionMajor, 3);
|
||||
Glfw.WindowHint(Hint.ContextVersionMinor, 3);
|
||||
Glfw.WindowHint(Hint.OpenglProfile, Profile.Core);
|
||||
Glfw.WindowHint(Hint.Doublebuffer, true);
|
||||
Glfw.WindowHint(Hint.Decorated, true);
|
||||
Glfw.WindowHint(Hint.OpenglForwardCompatible, true);
|
||||
|
||||
window = Glfw.CreateWindow(bmp.Width, bmp.Height, "yayy", Monitor.None, GLFW.Window.None);
|
||||
window = Glfw.CreateWindow(bmp.Width, bmp.Height, "yayy", Monitor.None, GLFW.Window.None);
|
||||
|
||||
Glfw.SetWindowSizeCallback(window, Resize);
|
||||
Glfw.SetMouseButtonCallback(window, Click);
|
||||
Glfw.SetCursorPositionCallback(window, Move);
|
||||
Glfw.SetScrollCallback(window, Scroll);
|
||||
Glfw.SetCursorEnterCallback(window, Leave);
|
||||
Glfw.SetWindowSizeCallback(window, Resize);
|
||||
Glfw.SetMouseButtonCallback(window, Click);
|
||||
Glfw.SetCursorPositionCallback(window, Move);
|
||||
Glfw.SetScrollCallback(window, Scroll);
|
||||
Glfw.SetCursorEnterCallback(window, Leave);
|
||||
|
||||
GCHandle handle = GCHandle.Alloc(this);
|
||||
Glfw.SetWindowUserPointer(window, GCHandle.ToIntPtr(handle));
|
||||
GCHandle handle = GCHandle.Alloc(this);
|
||||
Glfw.SetWindowUserPointer(window, GCHandle.ToIntPtr(handle));
|
||||
|
||||
Gl.Initialize();
|
||||
Glfw.MakeContextCurrent(window);
|
||||
Gl.Initialize();
|
||||
Glfw.MakeContextCurrent(window);
|
||||
|
||||
|
||||
string[] vertexShaderSource = {
|
||||
@"
|
||||
string[] vertexShaderSource = {
|
||||
@"
|
||||
#version 100
|
||||
precision mediump float;
|
||||
|
||||
@@ -156,10 +156,10 @@ void main()
|
||||
gl_Position = vec4(vertPos, 0.0, 1.0);
|
||||
}
|
||||
"
|
||||
};
|
||||
};
|
||||
|
||||
string[] fragmentShaderSource = {
|
||||
@"
|
||||
string[] fragmentShaderSource = {
|
||||
@"
|
||||
#version 100
|
||||
precision mediump float;
|
||||
|
||||
@@ -174,151 +174,153 @@ void main()
|
||||
gl_FragColor = texture2D(sTexture, tc);
|
||||
}
|
||||
"
|
||||
};
|
||||
};
|
||||
|
||||
uint vertexShader = Gl.CreateShader(ShaderType.VertexShader);
|
||||
Gl.ShaderSource(vertexShader, vertexShaderSource);
|
||||
Gl.CompileShader(vertexShader);
|
||||
uint vertexShader = Gl.CreateShader(ShaderType.VertexShader);
|
||||
Gl.ShaderSource(vertexShader, vertexShaderSource);
|
||||
Gl.CompileShader(vertexShader);
|
||||
|
||||
uint fragmentShader = Gl.CreateShader(ShaderType.FragmentShader);
|
||||
Gl.ShaderSource(fragmentShader, fragmentShaderSource);
|
||||
Gl.CompileShader(fragmentShader);
|
||||
uint fragmentShader = Gl.CreateShader(ShaderType.FragmentShader);
|
||||
Gl.ShaderSource(fragmentShader, fragmentShaderSource);
|
||||
Gl.CompileShader(fragmentShader);
|
||||
|
||||
shader_program = Gl.CreateProgram();
|
||||
Gl.AttachShader(shader_program, vertexShader);
|
||||
Gl.AttachShader(shader_program, fragmentShader);
|
||||
Gl.LinkProgram(shader_program);
|
||||
shader_program = Gl.CreateProgram();
|
||||
Gl.AttachShader(shader_program, vertexShader);
|
||||
Gl.AttachShader(shader_program, fragmentShader);
|
||||
Gl.LinkProgram(shader_program);
|
||||
|
||||
int length;
|
||||
StringBuilder stringBuilder = new StringBuilder(10000);
|
||||
Gl.GetShaderInfoLog(fragmentShader, 10000, out length, stringBuilder);
|
||||
System.Diagnostics.Debug.WriteLine(stringBuilder);
|
||||
stringBuilder.Clear();
|
||||
Gl.GetShaderInfoLog(vertexShader, 10000, out length, stringBuilder);
|
||||
System.Diagnostics.Debug.WriteLine(stringBuilder);
|
||||
stringBuilder.Clear();
|
||||
Gl.GetProgramInfoLog(shader_program, 10000, out length, stringBuilder);
|
||||
System.Diagnostics.Debug.WriteLine(stringBuilder);
|
||||
stringBuilder.Clear();
|
||||
int length;
|
||||
StringBuilder stringBuilder = new StringBuilder(10000);
|
||||
Gl.GetShaderInfoLog(fragmentShader, 10000, out length, stringBuilder);
|
||||
System.Diagnostics.Debug.WriteLine(stringBuilder);
|
||||
stringBuilder.Clear();
|
||||
Gl.GetShaderInfoLog(vertexShader, 10000, out length, stringBuilder);
|
||||
System.Diagnostics.Debug.WriteLine(stringBuilder);
|
||||
stringBuilder.Clear();
|
||||
Gl.GetProgramInfoLog(shader_program, 10000, out length, stringBuilder);
|
||||
System.Diagnostics.Debug.WriteLine(stringBuilder);
|
||||
stringBuilder.Clear();
|
||||
|
||||
Gl.UseProgram(shader_program);
|
||||
Gl.UseProgram(shader_program);
|
||||
|
||||
Gl.Uniform1(Gl.GetUniformLocation(shader_program, "sTexture"), 0);
|
||||
Gl.Uniform1(Gl.GetUniformLocation(shader_program, "sTexture"), 0);
|
||||
|
||||
|
||||
texture = Gl.GenTexture();
|
||||
texture = Gl.GenTexture();
|
||||
|
||||
Gl.ActiveTexture(TextureUnit.Texture0);
|
||||
Gl.BindTexture(TextureTarget.Texture2d, texture);
|
||||
Gl.TexParameteri(TextureTarget.Texture2d, TextureParameterName.TextureWrapS, TextureWrapMode.ClampToEdge);
|
||||
Gl.TexParameteri(TextureTarget.Texture2d, TextureParameterName.TextureWrapT, TextureWrapMode.ClampToEdge);
|
||||
Gl.TexParameteri(TextureTarget.Texture2d, TextureParameterName.TextureMagFilter, TextureMagFilter.Nearest);
|
||||
Gl.TexParameteri(TextureTarget.Texture2d, TextureParameterName.TextureMinFilter, TextureMagFilter.Nearest);
|
||||
Gl.ActiveTexture(TextureUnit.Texture0);
|
||||
Gl.BindTexture(TextureTarget.Texture2d, texture);
|
||||
Gl.TexParameteri(TextureTarget.Texture2d, TextureParameterName.TextureWrapS, TextureWrapMode.ClampToEdge);
|
||||
Gl.TexParameteri(TextureTarget.Texture2d, TextureParameterName.TextureWrapT, TextureWrapMode.ClampToEdge);
|
||||
Gl.TexParameteri(TextureTarget.Texture2d, TextureParameterName.TextureMagFilter, TextureMagFilter.Nearest);
|
||||
Gl.TexParameteri(TextureTarget.Texture2d, TextureParameterName.TextureMinFilter, TextureMagFilter.Nearest);
|
||||
|
||||
|
||||
float[] buf = { 1.0f, 1.0f, -1.0f, 1.0f, 1.0f, -1.0f, -1.0f, -1.0f };
|
||||
vertex_buf = Gl.GenBuffer();
|
||||
Gl.BindBuffer(BufferTarget.ArrayBuffer, vertex_buf);
|
||||
Gl.BufferData(BufferTarget.ArrayBuffer, (uint)(sizeof(float) * buf.Length), buf, BufferUsage.StaticDraw);
|
||||
float[] buf = { 1.0f, 1.0f, -1.0f, 1.0f, 1.0f, -1.0f, -1.0f, -1.0f };
|
||||
vertex_buf = Gl.GenBuffer();
|
||||
Gl.BindBuffer(BufferTarget.ArrayBuffer, vertex_buf);
|
||||
Gl.BufferData(BufferTarget.ArrayBuffer, (uint)(sizeof(float) * buf.Length), buf, BufferUsage.StaticDraw);
|
||||
|
||||
vao = Gl.GenVertexArray();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
public class WPFImage : ElementHost
|
||||
{
|
||||
public GlImage gl_img;
|
||||
|
||||
private int ByteSize;
|
||||
|
||||
private Rectangle rect1;
|
||||
|
||||
private Int32Rect rect2;
|
||||
|
||||
private BitmapData data;
|
||||
|
||||
public WriteableBitmap wb;
|
||||
|
||||
private bool HighQuality;
|
||||
|
||||
private string ConfigPath = Directory.GetCurrentDirectory() + "\\Config.ini";
|
||||
|
||||
public System.Windows.Controls.Image Image => (System.Windows.Controls.Image)base.Child;
|
||||
|
||||
public WPFImage()
|
||||
{
|
||||
System.Windows.Controls.Image child = new System.Windows.Controls.Image
|
||||
{
|
||||
Stretch = Stretch.Uniform
|
||||
};
|
||||
base.Child = child;
|
||||
|
||||
gl_img = new GlImage();
|
||||
vao = Gl.GenVertexArray();
|
||||
}
|
||||
}
|
||||
|
||||
public void PollEvents() {
|
||||
gl_img.PollEvents();
|
||||
}
|
||||
|
||||
public void ImageSetting()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!File.Exists(ConfigPath))
|
||||
{
|
||||
HighQuality = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
string[] source = ConfigPath.ReadLines();
|
||||
HighQuality = source.First((string s) => s.StartsWith("AntiAliasing:")).Last() == '1';
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
HighQuality = false;
|
||||
}
|
||||
if (HighQuality)
|
||||
{
|
||||
RenderOptions.SetBitmapScalingMode(Image, BitmapScalingMode.LowQuality);
|
||||
}
|
||||
else
|
||||
{
|
||||
RenderOptions.SetBitmapScalingMode(Image, BitmapScalingMode.NearestNeighbor);
|
||||
}
|
||||
RenderOptions.SetEdgeMode(Image, EdgeMode.Aliased);
|
||||
}
|
||||
/*
|
||||
public class WPFImage : ElementHost
|
||||
{
|
||||
public GlImage gl_img;
|
||||
|
||||
[DllImport("Kernel32.dll")]
|
||||
public static extern void CopyMemory(IntPtr Destination, IntPtr Source, int ByteSize);
|
||||
private int ByteSize;
|
||||
|
||||
private Rectangle rect1;
|
||||
|
||||
private Int32Rect rect2;
|
||||
|
||||
private BitmapData data;
|
||||
|
||||
public WriteableBitmap wb;
|
||||
|
||||
private bool HighQuality;
|
||||
|
||||
private string ConfigPath = Directory.GetCurrentDirectory() + "\\Config.ini";
|
||||
|
||||
public System.Windows.Controls.Image Image => (System.Windows.Controls.Image)base.Child;
|
||||
|
||||
public WPFImage()
|
||||
{
|
||||
System.Windows.Controls.Image child = new System.Windows.Controls.Image
|
||||
{
|
||||
Stretch = Stretch.Uniform
|
||||
};
|
||||
base.Child = child;
|
||||
|
||||
gl_img = new GlImage();
|
||||
}
|
||||
|
||||
public void PollEvents() {
|
||||
gl_img.PollEvents();
|
||||
}
|
||||
|
||||
public void ImageSetting()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!File.Exists(ConfigPath))
|
||||
{
|
||||
HighQuality = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
string[] source = ConfigPath.ReadLines();
|
||||
HighQuality = source.First((string s) => s.StartsWith("AntiAliasing:")).Last() == '1';
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
HighQuality = false;
|
||||
}
|
||||
if (HighQuality)
|
||||
{
|
||||
RenderOptions.SetBitmapScalingMode(Image, BitmapScalingMode.LowQuality);
|
||||
}
|
||||
else
|
||||
{
|
||||
RenderOptions.SetBitmapScalingMode(Image, BitmapScalingMode.NearestNeighbor);
|
||||
}
|
||||
RenderOptions.SetEdgeMode(Image, EdgeMode.Aliased);
|
||||
}
|
||||
|
||||
[DllImport("Kernel32.dll")]
|
||||
public static extern void CopyMemory(IntPtr Destination, IntPtr Source, int ByteSize);
|
||||
|
||||
|
||||
//the guy that gets called to update a frame
|
||||
public void SetBitmap(Bitmap bmp)
|
||||
{
|
||||
data = bmp.LockBits(rect1, ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
|
||||
wb.Lock();
|
||||
CopyMemory(wb.BackBuffer, data.Scan0, ByteSize);
|
||||
wb.AddDirtyRect(rect2);
|
||||
wb.Unlock();
|
||||
bmp.UnlockBits(data);
|
||||
//the guy that gets called to update a frame
|
||||
public void SetBitmap(Bitmap bmp)
|
||||
{
|
||||
data = bmp.LockBits(rect1, ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
|
||||
wb.Lock();
|
||||
CopyMemory(wb.BackBuffer, data.Scan0, ByteSize);
|
||||
wb.AddDirtyRect(rect2);
|
||||
wb.Unlock();
|
||||
bmp.UnlockBits(data);
|
||||
|
||||
gl_img.SetBitmap(bmp);
|
||||
}
|
||||
gl_img.SetBitmap(bmp);
|
||||
}
|
||||
|
||||
public void BitmapSetting(Bitmap bmp)
|
||||
{
|
||||
int pixelWidth = bmp.Width;
|
||||
int num = bmp.Height;
|
||||
rect1 = new Rectangle(0, 0, pixelWidth, num);
|
||||
rect2 = new Int32Rect(0, 0, pixelWidth, num);
|
||||
wb = new WriteableBitmap(pixelWidth, num, bmp.HorizontalResolution, bmp.VerticalResolution, PixelFormats.Bgra32, null);
|
||||
ByteSize = wb.BackBufferStride * num;
|
||||
Image.Source = wb;
|
||||
public void BitmapSetting(Bitmap bmp)
|
||||
{
|
||||
int pixelWidth = bmp.Width;
|
||||
int num = bmp.Height;
|
||||
rect1 = new Rectangle(0, 0, pixelWidth, num);
|
||||
rect2 = new Int32Rect(0, 0, pixelWidth, num);
|
||||
wb = new WriteableBitmap(pixelWidth, num, bmp.HorizontalResolution, bmp.VerticalResolution, PixelFormats.Bgra32, null);
|
||||
ByteSize = wb.BackBufferStride * num;
|
||||
Image.Source = wb;
|
||||
|
||||
gl_img.BitmapSetting(bmp);
|
||||
}
|
||||
|
||||
gl_img.BitmapSetting(bmp);
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
*/
|
||||
}
|
||||
@@ -1,66 +1,67 @@
|
||||
using System.Drawing;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
public static class _Con
|
||||
namespace _2DGAMELIB
|
||||
{
|
||||
public static Vector2D ToVector2D(this Point Point)
|
||||
{
|
||||
return new Vector2D(Point.X, Point.Y);
|
||||
}
|
||||
public static class _Con
|
||||
{
|
||||
public static Vector2D ToVector2D(this Point Point)
|
||||
{
|
||||
return new Vector2D(Point.X, Point.Y);
|
||||
}
|
||||
|
||||
public static Point ToPoint(this Vector2D Vector)
|
||||
{
|
||||
return new Point((int)Vector.X, (int)Vector.Y);
|
||||
}
|
||||
public static Point ToPoint(this Vector2D Vector)
|
||||
{
|
||||
return new Point((int)Vector.X, (int)Vector.Y);
|
||||
}
|
||||
|
||||
public static Point ToPoint(ref Vector2D Vector)
|
||||
{
|
||||
return new Point((int)Vector.X, (int)Vector.Y);
|
||||
}
|
||||
public static Point ToPoint(ref Vector2D Vector)
|
||||
{
|
||||
return new Point((int)Vector.X, (int)Vector.Y);
|
||||
}
|
||||
|
||||
public static Vector2D ToVector2D(this PointF Point)
|
||||
{
|
||||
return new Vector2D(Point.X, Point.Y);
|
||||
}
|
||||
public static Vector2D ToVector2D(this PointF Point)
|
||||
{
|
||||
return new Vector2D(Point.X, Point.Y);
|
||||
}
|
||||
|
||||
public static PointF ToPointF(this Vector2D Vector)
|
||||
{
|
||||
return new PointF((float)Vector.X, (float)Vector.Y);
|
||||
}
|
||||
public static PointF ToPointF(this Vector2D Vector)
|
||||
{
|
||||
return new PointF((float)Vector.X, (float)Vector.Y);
|
||||
}
|
||||
|
||||
public static PointF ToPointF(ref Vector2D Vector)
|
||||
{
|
||||
return new PointF((float)Vector.X, (float)Vector.Y);
|
||||
}
|
||||
public static PointF ToPointF(ref Vector2D Vector)
|
||||
{
|
||||
return new PointF((float)Vector.X, (float)Vector.Y);
|
||||
}
|
||||
|
||||
public static Vector2D ToVector2D(this Size Size)
|
||||
{
|
||||
return new Vector2D(Size.Width, Size.Height);
|
||||
}
|
||||
public static Vector2D ToVector2D(this Size Size)
|
||||
{
|
||||
return new Vector2D(Size.Width, Size.Height);
|
||||
}
|
||||
|
||||
public static Size ToSize(this Vector2D Vector)
|
||||
{
|
||||
return new Size((int)Vector.X, (int)Vector.Y);
|
||||
}
|
||||
public static Size ToSize(this Vector2D Vector)
|
||||
{
|
||||
return new Size((int)Vector.X, (int)Vector.Y);
|
||||
}
|
||||
|
||||
public static Size ToSize(ref Vector2D Vector)
|
||||
{
|
||||
return new Size((int)Vector.X, (int)Vector.Y);
|
||||
}
|
||||
public static Size ToSize(ref Vector2D Vector)
|
||||
{
|
||||
return new Size((int)Vector.X, (int)Vector.Y);
|
||||
}
|
||||
|
||||
public static Vector2D ToVector2D(this SizeF Size)
|
||||
{
|
||||
return new Vector2D(Size.Width, Size.Height);
|
||||
}
|
||||
public static Vector2D ToVector2D(this SizeF Size)
|
||||
{
|
||||
return new Vector2D(Size.Width, Size.Height);
|
||||
}
|
||||
|
||||
public static SizeF ToSizeF(this Vector2D Vector)
|
||||
{
|
||||
return new SizeF((float)Vector.X, (float)Vector.Y);
|
||||
}
|
||||
public static SizeF ToSizeF(this Vector2D Vector)
|
||||
{
|
||||
return new SizeF((float)Vector.X, (float)Vector.Y);
|
||||
}
|
||||
|
||||
public static SizeF ToSizeF(ref Vector2D Vector)
|
||||
{
|
||||
return new SizeF((float)Vector.X, (float)Vector.Y);
|
||||
}
|
||||
public static SizeF ToSizeF(ref Vector2D Vector)
|
||||
{
|
||||
return new SizeF((float)Vector.X, (float)Vector.Y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<LangVersion>10.0</LangVersion>
|
||||
<LangVersion>9.0</LangVersion>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
|
||||
@@ -1,427 +1,428 @@
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace SlaveMatrix;
|
||||
|
||||
[Serializable]
|
||||
public enum ConnectionInfo
|
||||
namespace SlaveMatrix
|
||||
{
|
||||
none,
|
||||
頭_基髪_接続,
|
||||
頭_目左_接続,
|
||||
頭_目右_接続,
|
||||
頭_鼻_接続,
|
||||
頭_口_接続,
|
||||
頭_頬左_接続,
|
||||
頭_頬右_接続,
|
||||
頭_額_接続,
|
||||
頭_眉左_接続,
|
||||
頭_眉右_接続,
|
||||
頭_耳左_接続,
|
||||
頭_耳右_接続,
|
||||
頭_鼻肌_接続,
|
||||
頭_単眼目_接続,
|
||||
頭_単眼眉_接続,
|
||||
頭_大顎基_接続,
|
||||
頭_顔面_接続,
|
||||
頭_頭頂_接続,
|
||||
頭_頬肌左_接続,
|
||||
頭_頬肌右_接続,
|
||||
頭_触覚左_接続,
|
||||
頭_触覚右_接続,
|
||||
基髪_頭頂左_接続,
|
||||
基髪_頭頂右_接続,
|
||||
基髪_横髪左_接続,
|
||||
基髪_横髪右_接続,
|
||||
基髪_前髪_接続,
|
||||
基髪_後髪_接続,
|
||||
後髪0_肢系_左5_接続,
|
||||
後髪0_肢系_左4_接続,
|
||||
後髪0_肢系_左3_接続,
|
||||
後髪0_肢系_左2_接続,
|
||||
後髪0_肢系_左1_接続,
|
||||
後髪0_肢系_中央_接続,
|
||||
後髪0_肢系_右1_接続,
|
||||
後髪0_肢系_右2_接続,
|
||||
後髪0_肢系_右3_接続,
|
||||
後髪0_肢系_右4_接続,
|
||||
後髪0_肢系_右5_接続,
|
||||
横髪_肢系_肢_接続,
|
||||
双目_瞼_接続,
|
||||
瞼_宇_涙_接続,
|
||||
単目_瞼_接続,
|
||||
頬目_瞼_接続,
|
||||
縦目_瞼_接続,
|
||||
鼻_人_鼻水左_接続,
|
||||
鼻_人_鼻水右_接続,
|
||||
鼻_獣_鼻水左_接続,
|
||||
鼻_獣_鼻水右_接続,
|
||||
吹出し_吹出し_接続,
|
||||
首_頭_接続,
|
||||
胸_首_接続,
|
||||
胸_肩左_接続,
|
||||
胸_肩右_接続,
|
||||
胸_胸左_接続,
|
||||
胸_胸右_接続,
|
||||
胸_肌_接続,
|
||||
胸_翼上左_接続,
|
||||
胸_翼上右_接続,
|
||||
胸_翼下左_接続,
|
||||
胸_翼下右_接続,
|
||||
胸_背中_接続,
|
||||
乳房_噴乳_接続,
|
||||
肩_上腕_接続,
|
||||
胴_胸_接続,
|
||||
胴_肌_接続,
|
||||
胴_翼左_接続,
|
||||
胴_翼右_接続,
|
||||
腰_胴_接続,
|
||||
腰_腿左_接続,
|
||||
腰_腿右_接続,
|
||||
腰_膣基_接続,
|
||||
腰_肛門_接続,
|
||||
腰_半身_接続,
|
||||
腰_尾_接続,
|
||||
腰_上着_接続,
|
||||
腰_肌_接続,
|
||||
腰_翼左_接続,
|
||||
腰_翼右_接続,
|
||||
ボテ腹_人_腹板_接続,
|
||||
ボテ腹_獣_腹板_接続,
|
||||
肛門_人_肛門精液_接続,
|
||||
肛門_獣_肛門精液_接続,
|
||||
性器_人_陰核_接続,
|
||||
性器_人_尿道_接続,
|
||||
性器_人_膣口_接続,
|
||||
性器_獣_陰核_接続,
|
||||
性器_獣_尿道_接続,
|
||||
性器_獣_膣口_接続,
|
||||
上着ボトム_クロス_上着ボトム後_接続,
|
||||
顔面_甲_触覚左_接続,
|
||||
顔面_甲_触覚右_接続,
|
||||
顔面_虫_触覚左_接続,
|
||||
顔面_虫_触覚右_接続,
|
||||
顔面_蟲_触覚左_接続,
|
||||
顔面_蟲_触覚右_接続,
|
||||
頭頂_宇_頭部後_接続,
|
||||
尾_蜘_出糸_接続,
|
||||
尾_ヘ_尾先_接続,
|
||||
尾_ウ_尾先_接続,
|
||||
尾_魚_左1_接続,
|
||||
尾_魚_右1_接続,
|
||||
尾_魚_左2_接続,
|
||||
尾_魚_右2_接続,
|
||||
尾_魚_左3_接続,
|
||||
尾_魚_右3_接続,
|
||||
尾_魚_左4_接続,
|
||||
尾_魚_右4_接続,
|
||||
尾_魚_左5_接続,
|
||||
尾_魚_右5_接続,
|
||||
尾_魚_左6_接続,
|
||||
尾_魚_右6_接続,
|
||||
尾_魚_左7_接続,
|
||||
尾_魚_右7_接続,
|
||||
尾_魚_左8_接続,
|
||||
尾_魚_右8_接続,
|
||||
尾_魚_左9_接続,
|
||||
尾_魚_右9_接続,
|
||||
尾_魚_左10_接続,
|
||||
尾_魚_右10_接続,
|
||||
尾_魚_左11_接続,
|
||||
尾_魚_右11_接続,
|
||||
尾_魚_左12_接続,
|
||||
尾_魚_右12_接続,
|
||||
尾_魚_左13_接続,
|
||||
尾_魚_右13_接続,
|
||||
尾_魚_左14_接続,
|
||||
尾_魚_右14_接続,
|
||||
尾_魚_左15_接続,
|
||||
尾_魚_右15_接続,
|
||||
尾_魚_左16_接続,
|
||||
尾_魚_右16_接続,
|
||||
尾_魚_左17_接続,
|
||||
尾_魚_右17_接続,
|
||||
尾_魚_左18_接続,
|
||||
尾_魚_右18_接続,
|
||||
尾_魚_左19_接続,
|
||||
尾_魚_右19_接続,
|
||||
尾_魚_左20_接続,
|
||||
尾_魚_右20_接続,
|
||||
尾_魚_左21_接続,
|
||||
尾_魚_右21_接続,
|
||||
尾_魚_左22_接続,
|
||||
尾_魚_右22_接続,
|
||||
尾_魚_左23_接続,
|
||||
尾_魚_右23_接続,
|
||||
尾_魚_左24_接続,
|
||||
尾_魚_右24_接続,
|
||||
尾_魚_左25_接続,
|
||||
尾_魚_右25_接続,
|
||||
尾_魚_左26_接続,
|
||||
尾_魚_右26_接続,
|
||||
尾_魚_左27_接続,
|
||||
尾_魚_右27_接続,
|
||||
尾_魚_左28_接続,
|
||||
尾_魚_右28_接続,
|
||||
尾_魚_左29_接続,
|
||||
尾_魚_右29_接続,
|
||||
尾_魚_左30_接続,
|
||||
尾_魚_右30_接続,
|
||||
尾_魚_左31_接続,
|
||||
尾_魚_右31_接続,
|
||||
尾_魚_左32_接続,
|
||||
尾_魚_右32_接続,
|
||||
尾_魚_左33_接続,
|
||||
尾_魚_右33_接続,
|
||||
尾_魚_左34_接続,
|
||||
尾_魚_右34_接続,
|
||||
尾_魚_尾先_接続,
|
||||
尾_鯨_左1_接続,
|
||||
尾_鯨_右1_接続,
|
||||
尾_鯨_左2_接続,
|
||||
尾_鯨_右2_接続,
|
||||
尾_鯨_左3_接続,
|
||||
尾_鯨_右3_接続,
|
||||
尾_鯨_左4_接続,
|
||||
尾_鯨_右4_接続,
|
||||
尾_鯨_左5_接続,
|
||||
尾_鯨_右5_接続,
|
||||
尾_鯨_左6_接続,
|
||||
尾_鯨_右6_接続,
|
||||
尾_鯨_左7_接続,
|
||||
尾_鯨_右7_接続,
|
||||
尾_鯨_左8_接続,
|
||||
尾_鯨_右8_接続,
|
||||
尾_鯨_左9_接続,
|
||||
尾_鯨_右9_接続,
|
||||
尾_鯨_左10_接続,
|
||||
尾_鯨_右10_接続,
|
||||
尾_鯨_左11_接続,
|
||||
尾_鯨_右11_接続,
|
||||
尾_鯨_左12_接続,
|
||||
尾_鯨_右12_接続,
|
||||
尾_鯨_左13_接続,
|
||||
尾_鯨_右13_接続,
|
||||
尾_鯨_左14_接続,
|
||||
尾_鯨_右14_接続,
|
||||
尾_鯨_左15_接続,
|
||||
尾_鯨_右15_接続,
|
||||
尾_鯨_左16_接続,
|
||||
尾_鯨_右16_接続,
|
||||
尾_鯨_左17_接続,
|
||||
尾_鯨_右17_接続,
|
||||
尾_鯨_左18_接続,
|
||||
尾_鯨_右18_接続,
|
||||
尾_鯨_左19_接続,
|
||||
尾_鯨_右19_接続,
|
||||
尾_鯨_左20_接続,
|
||||
尾_鯨_右20_接続,
|
||||
尾_鯨_左21_接続,
|
||||
尾_鯨_右21_接続,
|
||||
尾_鯨_左22_接続,
|
||||
尾_鯨_右22_接続,
|
||||
尾_鯨_左23_接続,
|
||||
尾_鯨_右23_接続,
|
||||
尾_鯨_左24_接続,
|
||||
尾_鯨_右24_接続,
|
||||
尾_鯨_左25_接続,
|
||||
尾_鯨_右25_接続,
|
||||
尾_鯨_左26_接続,
|
||||
尾_鯨_右26_接続,
|
||||
尾_鯨_左27_接続,
|
||||
尾_鯨_右27_接続,
|
||||
尾_鯨_左28_接続,
|
||||
尾_鯨_右28_接続,
|
||||
尾_鯨_左29_接続,
|
||||
尾_鯨_右29_接続,
|
||||
尾_鯨_左30_接続,
|
||||
尾_鯨_右30_接続,
|
||||
尾_鯨_左31_接続,
|
||||
尾_鯨_右31_接続,
|
||||
尾_鯨_左32_接続,
|
||||
尾_鯨_右32_接続,
|
||||
尾_鯨_左33_接続,
|
||||
尾_鯨_右33_接続,
|
||||
尾_鯨_左34_接続,
|
||||
尾_鯨_右34_接続,
|
||||
尾_鯨_尾先_接続,
|
||||
尾_蟲_左1_接続,
|
||||
尾_蟲_右1_接続,
|
||||
尾_蟲_左2_接続,
|
||||
尾_蟲_右2_接続,
|
||||
尾_蟲_左3_接続,
|
||||
尾_蟲_右3_接続,
|
||||
尾_蟲_左4_接続,
|
||||
尾_蟲_右4_接続,
|
||||
尾_蟲_左5_接続,
|
||||
尾_蟲_右5_接続,
|
||||
尾_蟲_尾左_接続,
|
||||
尾_蟲_尾右_接続,
|
||||
前翅_甲_軸1_接続,
|
||||
前翅_甲_軸2_接続,
|
||||
前翅_甲_軸3_接続,
|
||||
触手_犬_頭_接続,
|
||||
触手_犬_上腕左_接続,
|
||||
触手_犬_上腕右_接続,
|
||||
触手_犬_下腕左_接続,
|
||||
触手_犬_下腕右_接続,
|
||||
触手_犬_手左_接続,
|
||||
触手_犬_手右_接続,
|
||||
触手_蔦_節1_接続,
|
||||
触手_蔦_節2_接続,
|
||||
触手_蔦_節3_接続,
|
||||
触手_蔦_節4_接続,
|
||||
触手_蔦_節5_接続,
|
||||
触手_蔦_節6_接続,
|
||||
触手_蔦_節7_接続,
|
||||
触手_蔦_節8_接続,
|
||||
触手_蔦_節9_接続,
|
||||
触手_蔦_節10_接続,
|
||||
触手_蔦_節11_接続,
|
||||
触手_蔦_節12_接続,
|
||||
触手_蔦_節13_接続,
|
||||
触手_蔦_節14_接続,
|
||||
触手_蔦_節15_接続,
|
||||
触手_蔦_節16_接続,
|
||||
触手_蔦_節17_接続,
|
||||
触手_蔦_節18_接続,
|
||||
触手_蔦_節19_接続,
|
||||
触手_蔦_節20_接続,
|
||||
触手_蔦_節21_接続,
|
||||
触手_蔦_節22_接続,
|
||||
触手_蔦_節23_接続,
|
||||
触手_蔦_節24_接続,
|
||||
触手_蔦_先端_接続,
|
||||
上腕_人_下腕_接続,
|
||||
上腕_鳥_下腕_接続,
|
||||
上腕_蝙_下腕_接続,
|
||||
上腕_獣_下腕_接続,
|
||||
上腕_蹄_下腕_接続,
|
||||
下腕_人_外腕_接続,
|
||||
下腕_人_手_接続,
|
||||
下腕_人_虫鎌_接続,
|
||||
下腕_鳥_手_接続,
|
||||
下腕_蝙_手_接続,
|
||||
下腕_蝙_腕輪_接続,
|
||||
下腕_獣_手_接続,
|
||||
下腕_蹄_手_接続,
|
||||
腿_人_脚_接続,
|
||||
腿_獣_脚_接続,
|
||||
腿_蹄_脚_接続,
|
||||
腿_鳥_脚_接続,
|
||||
腿_竜_脚_接続,
|
||||
脚_人_足_接続,
|
||||
脚_人_脚輪下_接続,
|
||||
脚_人_脚輪上_接続,
|
||||
脚_獣_足_接続,
|
||||
脚_蹄_足_接続,
|
||||
脚_鳥_足_接続,
|
||||
脚_竜_足_接続,
|
||||
長物_魚_左0_接続,
|
||||
長物_魚_右0_接続,
|
||||
長物_魚_左1_接続,
|
||||
長物_魚_右1_接続,
|
||||
長物_魚_左2_接続,
|
||||
長物_魚_右2_接続,
|
||||
長物_魚_左3_接続,
|
||||
長物_魚_右3_接続,
|
||||
長物_魚_左4_接続,
|
||||
長物_魚_右4_接続,
|
||||
長物_魚_左5_接続,
|
||||
長物_魚_右5_接続,
|
||||
長物_魚_左6_接続,
|
||||
長物_魚_右6_接続,
|
||||
長物_魚_尾_接続,
|
||||
長物_鯨_左0_接続,
|
||||
長物_鯨_右0_接続,
|
||||
長物_鯨_左1_接続,
|
||||
長物_鯨_右1_接続,
|
||||
長物_鯨_左2_接続,
|
||||
長物_鯨_右2_接続,
|
||||
長物_鯨_左3_接続,
|
||||
長物_鯨_右3_接続,
|
||||
長物_鯨_左4_接続,
|
||||
長物_鯨_右4_接続,
|
||||
長物_鯨_左5_接続,
|
||||
長物_鯨_右5_接続,
|
||||
長物_鯨_左6_接続,
|
||||
長物_鯨_右6_接続,
|
||||
長物_鯨_尾_接続,
|
||||
長物_蛇_左_接続,
|
||||
長物_蛇_右_接続,
|
||||
長物_蛇_胴_接続,
|
||||
長物_蟲_左0_接続,
|
||||
長物_蟲_右0_接続,
|
||||
長物_蟲_左1_接続,
|
||||
長物_蟲_右1_接続,
|
||||
長物_蟲_胴_接続,
|
||||
四足胸_脇左_接続,
|
||||
四足胸_脇右_接続,
|
||||
四足胸_胴_接続,
|
||||
四足胸_胸左_接続,
|
||||
四足胸_胸右_接続,
|
||||
四足胸_肌_接続,
|
||||
四足胸_翼上左_接続,
|
||||
四足胸_翼上右_接続,
|
||||
四足胸_翼下左_接続,
|
||||
四足胸_翼下右_接続,
|
||||
四足胸_背中_接続,
|
||||
四足脇_上腕_接続,
|
||||
四足胴_腰_接続,
|
||||
四足胴_肌_接続,
|
||||
四足胴_翼左_接続,
|
||||
四足胴_翼右_接続,
|
||||
四足腰_腿左_接続,
|
||||
四足腰_腿右_接続,
|
||||
四足腰_膣基_接続,
|
||||
四足腰_肛門_接続,
|
||||
四足腰_尾_接続,
|
||||
四足腰_半身_接続,
|
||||
四足腰_上着_接続,
|
||||
四足腰_肌_接続,
|
||||
四足腰_翼左_接続,
|
||||
四足腰_翼右_接続,
|
||||
多足_蛸_軟体外左_接続,
|
||||
多足_蛸_軟体外右_接続,
|
||||
多足_蛸_軟体内左_接続,
|
||||
多足_蛸_軟体内右_接続,
|
||||
多足_蜘_触肢左_接続,
|
||||
多足_蜘_触肢右_接続,
|
||||
多足_蜘_節足左1_接続,
|
||||
多足_蜘_節足左2_接続,
|
||||
多足_蜘_節足左3_接続,
|
||||
多足_蜘_節足左4_接続,
|
||||
多足_蜘_節足右1_接続,
|
||||
多足_蜘_節足右2_接続,
|
||||
多足_蜘_節足右3_接続,
|
||||
多足_蜘_節足右4_接続,
|
||||
多足_蜘_尾_接続,
|
||||
多足_蠍_触肢左_接続,
|
||||
多足_蠍_節足左1_接続,
|
||||
多足_蠍_節足左2_接続,
|
||||
多足_蠍_節足左3_接続,
|
||||
多足_蠍_節足左4_接続,
|
||||
多足_蠍_触肢右_接続,
|
||||
多足_蠍_節足右1_接続,
|
||||
多足_蠍_節足右2_接続,
|
||||
多足_蠍_節足右3_接続,
|
||||
多足_蠍_節足右4_接続,
|
||||
多足_蠍_櫛状板左_接続,
|
||||
多足_蠍_櫛状板右_接続,
|
||||
多足_蠍_尾_接続,
|
||||
単足_植_根外左_接続,
|
||||
単足_植_根内左_接続,
|
||||
単足_植_根中央_接続,
|
||||
単足_植_根内右_接続,
|
||||
単足_植_根外右_接続,
|
||||
胴_蛇_左_接続,
|
||||
胴_蛇_右_接続,
|
||||
胴_蛇_胴_接続,
|
||||
胴_蟲_左_接続,
|
||||
胴_蟲_右_接続,
|
||||
胴_蟲_胴_接続,
|
||||
大顎基_顎左_接続,
|
||||
大顎基_顎右_接続,
|
||||
植_花_接続,
|
||||
ペニス_尿道_接続
|
||||
[Serializable]
|
||||
public enum ConnectionInfo
|
||||
{
|
||||
none,
|
||||
頭_基髪_接続,
|
||||
頭_目左_接続,
|
||||
頭_目右_接続,
|
||||
頭_鼻_接続,
|
||||
頭_口_接続,
|
||||
頭_頬左_接続,
|
||||
頭_頬右_接続,
|
||||
頭_額_接続,
|
||||
頭_眉左_接続,
|
||||
頭_眉右_接続,
|
||||
頭_耳左_接続,
|
||||
頭_耳右_接続,
|
||||
頭_鼻肌_接続,
|
||||
頭_単眼目_接続,
|
||||
頭_単眼眉_接続,
|
||||
頭_大顎基_接続,
|
||||
頭_顔面_接続,
|
||||
頭_頭頂_接続,
|
||||
頭_頬肌左_接続,
|
||||
頭_頬肌右_接続,
|
||||
頭_触覚左_接続,
|
||||
頭_触覚右_接続,
|
||||
基髪_頭頂左_接続,
|
||||
基髪_頭頂右_接続,
|
||||
基髪_横髪左_接続,
|
||||
基髪_横髪右_接続,
|
||||
基髪_前髪_接続,
|
||||
基髪_後髪_接続,
|
||||
後髪0_肢系_左5_接続,
|
||||
後髪0_肢系_左4_接続,
|
||||
後髪0_肢系_左3_接続,
|
||||
後髪0_肢系_左2_接続,
|
||||
後髪0_肢系_左1_接続,
|
||||
後髪0_肢系_中央_接続,
|
||||
後髪0_肢系_右1_接続,
|
||||
後髪0_肢系_右2_接続,
|
||||
後髪0_肢系_右3_接続,
|
||||
後髪0_肢系_右4_接続,
|
||||
後髪0_肢系_右5_接続,
|
||||
横髪_肢系_肢_接続,
|
||||
双目_瞼_接続,
|
||||
瞼_宇_涙_接続,
|
||||
単目_瞼_接続,
|
||||
頬目_瞼_接続,
|
||||
縦目_瞼_接続,
|
||||
鼻_人_鼻水左_接続,
|
||||
鼻_人_鼻水右_接続,
|
||||
鼻_獣_鼻水左_接続,
|
||||
鼻_獣_鼻水右_接続,
|
||||
吹出し_吹出し_接続,
|
||||
首_頭_接続,
|
||||
胸_首_接続,
|
||||
胸_肩左_接続,
|
||||
胸_肩右_接続,
|
||||
胸_胸左_接続,
|
||||
胸_胸右_接続,
|
||||
胸_肌_接続,
|
||||
胸_翼上左_接続,
|
||||
胸_翼上右_接続,
|
||||
胸_翼下左_接続,
|
||||
胸_翼下右_接続,
|
||||
胸_背中_接続,
|
||||
乳房_噴乳_接続,
|
||||
肩_上腕_接続,
|
||||
胴_胸_接続,
|
||||
胴_肌_接続,
|
||||
胴_翼左_接続,
|
||||
胴_翼右_接続,
|
||||
腰_胴_接続,
|
||||
腰_腿左_接続,
|
||||
腰_腿右_接続,
|
||||
腰_膣基_接続,
|
||||
腰_肛門_接続,
|
||||
腰_半身_接続,
|
||||
腰_尾_接続,
|
||||
腰_上着_接続,
|
||||
腰_肌_接続,
|
||||
腰_翼左_接続,
|
||||
腰_翼右_接続,
|
||||
ボテ腹_人_腹板_接続,
|
||||
ボテ腹_獣_腹板_接続,
|
||||
肛門_人_肛門精液_接続,
|
||||
肛門_獣_肛門精液_接続,
|
||||
性器_人_陰核_接続,
|
||||
性器_人_尿道_接続,
|
||||
性器_人_膣口_接続,
|
||||
性器_獣_陰核_接続,
|
||||
性器_獣_尿道_接続,
|
||||
性器_獣_膣口_接続,
|
||||
上着ボトム_クロス_上着ボトム後_接続,
|
||||
顔面_甲_触覚左_接続,
|
||||
顔面_甲_触覚右_接続,
|
||||
顔面_虫_触覚左_接続,
|
||||
顔面_虫_触覚右_接続,
|
||||
顔面_蟲_触覚左_接続,
|
||||
顔面_蟲_触覚右_接続,
|
||||
頭頂_宇_頭部後_接続,
|
||||
尾_蜘_出糸_接続,
|
||||
尾_ヘ_尾先_接続,
|
||||
尾_ウ_尾先_接続,
|
||||
尾_魚_左1_接続,
|
||||
尾_魚_右1_接続,
|
||||
尾_魚_左2_接続,
|
||||
尾_魚_右2_接続,
|
||||
尾_魚_左3_接続,
|
||||
尾_魚_右3_接続,
|
||||
尾_魚_左4_接続,
|
||||
尾_魚_右4_接続,
|
||||
尾_魚_左5_接続,
|
||||
尾_魚_右5_接続,
|
||||
尾_魚_左6_接続,
|
||||
尾_魚_右6_接続,
|
||||
尾_魚_左7_接続,
|
||||
尾_魚_右7_接続,
|
||||
尾_魚_左8_接続,
|
||||
尾_魚_右8_接続,
|
||||
尾_魚_左9_接続,
|
||||
尾_魚_右9_接続,
|
||||
尾_魚_左10_接続,
|
||||
尾_魚_右10_接続,
|
||||
尾_魚_左11_接続,
|
||||
尾_魚_右11_接続,
|
||||
尾_魚_左12_接続,
|
||||
尾_魚_右12_接続,
|
||||
尾_魚_左13_接続,
|
||||
尾_魚_右13_接続,
|
||||
尾_魚_左14_接続,
|
||||
尾_魚_右14_接続,
|
||||
尾_魚_左15_接続,
|
||||
尾_魚_右15_接続,
|
||||
尾_魚_左16_接続,
|
||||
尾_魚_右16_接続,
|
||||
尾_魚_左17_接続,
|
||||
尾_魚_右17_接続,
|
||||
尾_魚_左18_接続,
|
||||
尾_魚_右18_接続,
|
||||
尾_魚_左19_接続,
|
||||
尾_魚_右19_接続,
|
||||
尾_魚_左20_接続,
|
||||
尾_魚_右20_接続,
|
||||
尾_魚_左21_接続,
|
||||
尾_魚_右21_接続,
|
||||
尾_魚_左22_接続,
|
||||
尾_魚_右22_接続,
|
||||
尾_魚_左23_接続,
|
||||
尾_魚_右23_接続,
|
||||
尾_魚_左24_接続,
|
||||
尾_魚_右24_接続,
|
||||
尾_魚_左25_接続,
|
||||
尾_魚_右25_接続,
|
||||
尾_魚_左26_接続,
|
||||
尾_魚_右26_接続,
|
||||
尾_魚_左27_接続,
|
||||
尾_魚_右27_接続,
|
||||
尾_魚_左28_接続,
|
||||
尾_魚_右28_接続,
|
||||
尾_魚_左29_接続,
|
||||
尾_魚_右29_接続,
|
||||
尾_魚_左30_接続,
|
||||
尾_魚_右30_接続,
|
||||
尾_魚_左31_接続,
|
||||
尾_魚_右31_接続,
|
||||
尾_魚_左32_接続,
|
||||
尾_魚_右32_接続,
|
||||
尾_魚_左33_接続,
|
||||
尾_魚_右33_接続,
|
||||
尾_魚_左34_接続,
|
||||
尾_魚_右34_接続,
|
||||
尾_魚_尾先_接続,
|
||||
尾_鯨_左1_接続,
|
||||
尾_鯨_右1_接続,
|
||||
尾_鯨_左2_接続,
|
||||
尾_鯨_右2_接続,
|
||||
尾_鯨_左3_接続,
|
||||
尾_鯨_右3_接続,
|
||||
尾_鯨_左4_接続,
|
||||
尾_鯨_右4_接続,
|
||||
尾_鯨_左5_接続,
|
||||
尾_鯨_右5_接続,
|
||||
尾_鯨_左6_接続,
|
||||
尾_鯨_右6_接続,
|
||||
尾_鯨_左7_接続,
|
||||
尾_鯨_右7_接続,
|
||||
尾_鯨_左8_接続,
|
||||
尾_鯨_右8_接続,
|
||||
尾_鯨_左9_接続,
|
||||
尾_鯨_右9_接続,
|
||||
尾_鯨_左10_接続,
|
||||
尾_鯨_右10_接続,
|
||||
尾_鯨_左11_接続,
|
||||
尾_鯨_右11_接続,
|
||||
尾_鯨_左12_接続,
|
||||
尾_鯨_右12_接続,
|
||||
尾_鯨_左13_接続,
|
||||
尾_鯨_右13_接続,
|
||||
尾_鯨_左14_接続,
|
||||
尾_鯨_右14_接続,
|
||||
尾_鯨_左15_接続,
|
||||
尾_鯨_右15_接続,
|
||||
尾_鯨_左16_接続,
|
||||
尾_鯨_右16_接続,
|
||||
尾_鯨_左17_接続,
|
||||
尾_鯨_右17_接続,
|
||||
尾_鯨_左18_接続,
|
||||
尾_鯨_右18_接続,
|
||||
尾_鯨_左19_接続,
|
||||
尾_鯨_右19_接続,
|
||||
尾_鯨_左20_接続,
|
||||
尾_鯨_右20_接続,
|
||||
尾_鯨_左21_接続,
|
||||
尾_鯨_右21_接続,
|
||||
尾_鯨_左22_接続,
|
||||
尾_鯨_右22_接続,
|
||||
尾_鯨_左23_接続,
|
||||
尾_鯨_右23_接続,
|
||||
尾_鯨_左24_接続,
|
||||
尾_鯨_右24_接続,
|
||||
尾_鯨_左25_接続,
|
||||
尾_鯨_右25_接続,
|
||||
尾_鯨_左26_接続,
|
||||
尾_鯨_右26_接続,
|
||||
尾_鯨_左27_接続,
|
||||
尾_鯨_右27_接続,
|
||||
尾_鯨_左28_接続,
|
||||
尾_鯨_右28_接続,
|
||||
尾_鯨_左29_接続,
|
||||
尾_鯨_右29_接続,
|
||||
尾_鯨_左30_接続,
|
||||
尾_鯨_右30_接続,
|
||||
尾_鯨_左31_接続,
|
||||
尾_鯨_右31_接続,
|
||||
尾_鯨_左32_接続,
|
||||
尾_鯨_右32_接続,
|
||||
尾_鯨_左33_接続,
|
||||
尾_鯨_右33_接続,
|
||||
尾_鯨_左34_接続,
|
||||
尾_鯨_右34_接続,
|
||||
尾_鯨_尾先_接続,
|
||||
尾_蟲_左1_接続,
|
||||
尾_蟲_右1_接続,
|
||||
尾_蟲_左2_接続,
|
||||
尾_蟲_右2_接続,
|
||||
尾_蟲_左3_接続,
|
||||
尾_蟲_右3_接続,
|
||||
尾_蟲_左4_接続,
|
||||
尾_蟲_右4_接続,
|
||||
尾_蟲_左5_接続,
|
||||
尾_蟲_右5_接続,
|
||||
尾_蟲_尾左_接続,
|
||||
尾_蟲_尾右_接続,
|
||||
前翅_甲_軸1_接続,
|
||||
前翅_甲_軸2_接続,
|
||||
前翅_甲_軸3_接続,
|
||||
触手_犬_頭_接続,
|
||||
触手_犬_上腕左_接続,
|
||||
触手_犬_上腕右_接続,
|
||||
触手_犬_下腕左_接続,
|
||||
触手_犬_下腕右_接続,
|
||||
触手_犬_手左_接続,
|
||||
触手_犬_手右_接続,
|
||||
触手_蔦_節1_接続,
|
||||
触手_蔦_節2_接続,
|
||||
触手_蔦_節3_接続,
|
||||
触手_蔦_節4_接続,
|
||||
触手_蔦_節5_接続,
|
||||
触手_蔦_節6_接続,
|
||||
触手_蔦_節7_接続,
|
||||
触手_蔦_節8_接続,
|
||||
触手_蔦_節9_接続,
|
||||
触手_蔦_節10_接続,
|
||||
触手_蔦_節11_接続,
|
||||
触手_蔦_節12_接続,
|
||||
触手_蔦_節13_接続,
|
||||
触手_蔦_節14_接続,
|
||||
触手_蔦_節15_接続,
|
||||
触手_蔦_節16_接続,
|
||||
触手_蔦_節17_接続,
|
||||
触手_蔦_節18_接続,
|
||||
触手_蔦_節19_接続,
|
||||
触手_蔦_節20_接続,
|
||||
触手_蔦_節21_接続,
|
||||
触手_蔦_節22_接続,
|
||||
触手_蔦_節23_接続,
|
||||
触手_蔦_節24_接続,
|
||||
触手_蔦_先端_接続,
|
||||
上腕_人_下腕_接続,
|
||||
上腕_鳥_下腕_接続,
|
||||
上腕_蝙_下腕_接続,
|
||||
上腕_獣_下腕_接続,
|
||||
上腕_蹄_下腕_接続,
|
||||
下腕_人_外腕_接続,
|
||||
下腕_人_手_接続,
|
||||
下腕_人_虫鎌_接続,
|
||||
下腕_鳥_手_接続,
|
||||
下腕_蝙_手_接続,
|
||||
下腕_蝙_腕輪_接続,
|
||||
下腕_獣_手_接続,
|
||||
下腕_蹄_手_接続,
|
||||
腿_人_脚_接続,
|
||||
腿_獣_脚_接続,
|
||||
腿_蹄_脚_接続,
|
||||
腿_鳥_脚_接続,
|
||||
腿_竜_脚_接続,
|
||||
脚_人_足_接続,
|
||||
脚_人_脚輪下_接続,
|
||||
脚_人_脚輪上_接続,
|
||||
脚_獣_足_接続,
|
||||
脚_蹄_足_接続,
|
||||
脚_鳥_足_接続,
|
||||
脚_竜_足_接続,
|
||||
長物_魚_左0_接続,
|
||||
長物_魚_右0_接続,
|
||||
長物_魚_左1_接続,
|
||||
長物_魚_右1_接続,
|
||||
長物_魚_左2_接続,
|
||||
長物_魚_右2_接続,
|
||||
長物_魚_左3_接続,
|
||||
長物_魚_右3_接続,
|
||||
長物_魚_左4_接続,
|
||||
長物_魚_右4_接続,
|
||||
長物_魚_左5_接続,
|
||||
長物_魚_右5_接続,
|
||||
長物_魚_左6_接続,
|
||||
長物_魚_右6_接続,
|
||||
長物_魚_尾_接続,
|
||||
長物_鯨_左0_接続,
|
||||
長物_鯨_右0_接続,
|
||||
長物_鯨_左1_接続,
|
||||
長物_鯨_右1_接続,
|
||||
長物_鯨_左2_接続,
|
||||
長物_鯨_右2_接続,
|
||||
長物_鯨_左3_接続,
|
||||
長物_鯨_右3_接続,
|
||||
長物_鯨_左4_接続,
|
||||
長物_鯨_右4_接続,
|
||||
長物_鯨_左5_接続,
|
||||
長物_鯨_右5_接続,
|
||||
長物_鯨_左6_接続,
|
||||
長物_鯨_右6_接続,
|
||||
長物_鯨_尾_接続,
|
||||
長物_蛇_左_接続,
|
||||
長物_蛇_右_接続,
|
||||
長物_蛇_胴_接続,
|
||||
長物_蟲_左0_接続,
|
||||
長物_蟲_右0_接続,
|
||||
長物_蟲_左1_接続,
|
||||
長物_蟲_右1_接続,
|
||||
長物_蟲_胴_接続,
|
||||
四足胸_脇左_接続,
|
||||
四足胸_脇右_接続,
|
||||
四足胸_胴_接続,
|
||||
四足胸_胸左_接続,
|
||||
四足胸_胸右_接続,
|
||||
四足胸_肌_接続,
|
||||
四足胸_翼上左_接続,
|
||||
四足胸_翼上右_接続,
|
||||
四足胸_翼下左_接続,
|
||||
四足胸_翼下右_接続,
|
||||
四足胸_背中_接続,
|
||||
四足脇_上腕_接続,
|
||||
四足胴_腰_接続,
|
||||
四足胴_肌_接続,
|
||||
四足胴_翼左_接続,
|
||||
四足胴_翼右_接続,
|
||||
四足腰_腿左_接続,
|
||||
四足腰_腿右_接続,
|
||||
四足腰_膣基_接続,
|
||||
四足腰_肛門_接続,
|
||||
四足腰_尾_接続,
|
||||
四足腰_半身_接続,
|
||||
四足腰_上着_接続,
|
||||
四足腰_肌_接続,
|
||||
四足腰_翼左_接続,
|
||||
四足腰_翼右_接続,
|
||||
多足_蛸_軟体外左_接続,
|
||||
多足_蛸_軟体外右_接続,
|
||||
多足_蛸_軟体内左_接続,
|
||||
多足_蛸_軟体内右_接続,
|
||||
多足_蜘_触肢左_接続,
|
||||
多足_蜘_触肢右_接続,
|
||||
多足_蜘_節足左1_接続,
|
||||
多足_蜘_節足左2_接続,
|
||||
多足_蜘_節足左3_接続,
|
||||
多足_蜘_節足左4_接続,
|
||||
多足_蜘_節足右1_接続,
|
||||
多足_蜘_節足右2_接続,
|
||||
多足_蜘_節足右3_接続,
|
||||
多足_蜘_節足右4_接続,
|
||||
多足_蜘_尾_接続,
|
||||
多足_蠍_触肢左_接続,
|
||||
多足_蠍_節足左1_接続,
|
||||
多足_蠍_節足左2_接続,
|
||||
多足_蠍_節足左3_接続,
|
||||
多足_蠍_節足左4_接続,
|
||||
多足_蠍_触肢右_接続,
|
||||
多足_蠍_節足右1_接続,
|
||||
多足_蠍_節足右2_接続,
|
||||
多足_蠍_節足右3_接続,
|
||||
多足_蠍_節足右4_接続,
|
||||
多足_蠍_櫛状板左_接続,
|
||||
多足_蠍_櫛状板右_接続,
|
||||
多足_蠍_尾_接続,
|
||||
単足_植_根外左_接続,
|
||||
単足_植_根内左_接続,
|
||||
単足_植_根中央_接続,
|
||||
単足_植_根内右_接続,
|
||||
単足_植_根外右_接続,
|
||||
胴_蛇_左_接続,
|
||||
胴_蛇_右_接続,
|
||||
胴_蛇_胴_接続,
|
||||
胴_蟲_左_接続,
|
||||
胴_蟲_右_接続,
|
||||
胴_蟲_胴_接続,
|
||||
大顎基_顎左_接続,
|
||||
大顎基_顎右_接続,
|
||||
植_花_接続,
|
||||
ペニス_尿道_接続
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
using _2DGAMELIB;
|
||||
|
||||
namespace SlaveMatrix;
|
||||
|
||||
public struct ContactD
|
||||
namespace SlaveMatrix
|
||||
{
|
||||
public ContactType c;
|
||||
public struct ContactD
|
||||
{
|
||||
public ContactType c;
|
||||
|
||||
public Ele e;
|
||||
public Ele e;
|
||||
|
||||
public Par p;
|
||||
public Par p;
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return ("接触:" + c).ToString() + "\r\n" + ("Ele:" + ((e == null) ? "null" : e.ToString())).ToString() + "\r\n" + ("Par:" + ((p == null) ? "null" : p.ToString())).ToString();
|
||||
}
|
||||
public override string ToString()
|
||||
{
|
||||
return ("接触:" + c).ToString() + "\r\n" + ("Ele:" + ((e == null) ? "null" : e.ToString())).ToString() + "\r\n" + ("Par:" + ((p == null) ? "null" : p.ToString())).ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,358 +3,359 @@ using System.Drawing;
|
||||
using System.Linq;
|
||||
using _2DGAMELIB;
|
||||
|
||||
namespace SlaveMatrix;
|
||||
|
||||
public class InfoPanel
|
||||
namespace SlaveMatrix
|
||||
{
|
||||
public Are Are;
|
||||
public class InfoPanel
|
||||
{
|
||||
public Are Are;
|
||||
|
||||
private Med Med;
|
||||
private Med Med;
|
||||
|
||||
public Par MaiB;
|
||||
public Par MaiB;
|
||||
|
||||
public Tex Mai;
|
||||
public Tex Mai;
|
||||
|
||||
public Par Mai2B;
|
||||
public Par Mai2B;
|
||||
|
||||
public Tex Mai2;
|
||||
public Tex Mai2;
|
||||
|
||||
public Par SubB;
|
||||
public Par SubB;
|
||||
|
||||
public Tex Sub;
|
||||
public Tex Sub;
|
||||
|
||||
public Par Sub2B;
|
||||
public Par Sub2B;
|
||||
|
||||
public Tex Sub2;
|
||||
public Tex Sub2;
|
||||
|
||||
private Lab SubInnfo_l;
|
||||
private Lab SubInnfo_l;
|
||||
|
||||
public bool MaiShow = true;
|
||||
public bool MaiShow = true;
|
||||
|
||||
public bool Mai2Show = true;
|
||||
public bool Mai2Show = true;
|
||||
|
||||
public bool SubShow = true;
|
||||
public bool SubShow = true;
|
||||
|
||||
public bool Sub2Show = true;
|
||||
public bool Sub2Show = true;
|
||||
|
||||
private ParT yp;
|
||||
private ParT yp;
|
||||
|
||||
private ParT np;
|
||||
private ParT np;
|
||||
|
||||
public But1 yb;
|
||||
public But1 yb;
|
||||
|
||||
public But1 nb;
|
||||
public But1 nb;
|
||||
|
||||
public string TextIm
|
||||
{
|
||||
get
|
||||
{
|
||||
return Mai.TextIm;
|
||||
}
|
||||
set
|
||||
{
|
||||
Mai.TextIm = value;
|
||||
}
|
||||
}
|
||||
public string TextIm
|
||||
{
|
||||
get
|
||||
{
|
||||
return Mai.TextIm;
|
||||
}
|
||||
set
|
||||
{
|
||||
Mai.TextIm = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string Text
|
||||
{
|
||||
get
|
||||
{
|
||||
return Mai.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
Mai.Text = value;
|
||||
}
|
||||
}
|
||||
public string Text
|
||||
{
|
||||
get
|
||||
{
|
||||
return Mai.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
Mai.Text = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string Mai2Im
|
||||
{
|
||||
get
|
||||
{
|
||||
return Mai2.TextIm;
|
||||
}
|
||||
set
|
||||
{
|
||||
Mai2.TextIm = value;
|
||||
}
|
||||
}
|
||||
public string Mai2Im
|
||||
{
|
||||
get
|
||||
{
|
||||
return Mai2.TextIm;
|
||||
}
|
||||
set
|
||||
{
|
||||
Mai2.TextIm = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string SubInfoIm
|
||||
{
|
||||
get
|
||||
{
|
||||
return Sub.TextIm;
|
||||
}
|
||||
set
|
||||
{
|
||||
Sub.TextIm = value;
|
||||
}
|
||||
}
|
||||
public string SubInfoIm
|
||||
{
|
||||
get
|
||||
{
|
||||
return Sub.TextIm;
|
||||
}
|
||||
set
|
||||
{
|
||||
Sub.TextIm = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string SubInfo
|
||||
{
|
||||
get
|
||||
{
|
||||
return Sub.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
Sub.Text = value;
|
||||
}
|
||||
}
|
||||
public string SubInfo
|
||||
{
|
||||
get
|
||||
{
|
||||
return Sub.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
Sub.Text = value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool 選択肢表示
|
||||
{
|
||||
get
|
||||
{
|
||||
return yp.Dra;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetButPos();
|
||||
yp.Dra = value;
|
||||
np.Dra = value;
|
||||
}
|
||||
}
|
||||
public bool 選択肢表示
|
||||
{
|
||||
get
|
||||
{
|
||||
return yp.Dra;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetButPos();
|
||||
yp.Dra = value;
|
||||
np.Dra = value;
|
||||
}
|
||||
}
|
||||
|
||||
public Action<But> 選択yAct
|
||||
{
|
||||
set
|
||||
{
|
||||
yb.Action = delegate(But a)
|
||||
{
|
||||
value(a);
|
||||
};
|
||||
}
|
||||
}
|
||||
public Action<But> 選択yAct
|
||||
{
|
||||
set
|
||||
{
|
||||
yb.Action = delegate(But a)
|
||||
{
|
||||
value(a);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public Action<But> 選択nAct
|
||||
{
|
||||
set
|
||||
{
|
||||
nb.Action = delegate(But a)
|
||||
{
|
||||
value(a);
|
||||
};
|
||||
}
|
||||
}
|
||||
public Action<But> 選択nAct
|
||||
{
|
||||
set
|
||||
{
|
||||
nb.Action = delegate(But a)
|
||||
{
|
||||
value(a);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public InfoPanel(Med Med, Are Are)
|
||||
{
|
||||
this.Med = Med;
|
||||
this.Are = Are;
|
||||
double num = 0.015;
|
||||
double num2 = 0.1;
|
||||
double num3 = Are.LocalWidth * 0.6 / num2;
|
||||
double num4 = Are.LocalHeight * (1.0 / 6.0) / num2;
|
||||
Vector2D vector2D = Are.GetPosition(0.2, 1.0 - num4 * num2 / Are.LocalHeight).AddY(0.0 - num);
|
||||
double y = 1.01;
|
||||
MaiB = new Par();
|
||||
MaiB.BasePointBase = Dat.Vec2DZero;
|
||||
MaiB.PositionBase = vector2D;
|
||||
MaiB.SizeBase = num2;
|
||||
MaiB.OP.AddRange(new Out[1] { Shas.Get正方形() });
|
||||
MaiB.OP.ScalingX(MaiB.BasePointBase, num3);
|
||||
MaiB.OP.ScalingY(MaiB.BasePointBase, num4);
|
||||
MaiB.Closed = true;
|
||||
MaiB.BrushColor = Color.FromArgb(160, Col.Black);
|
||||
MaiB.Hit = false;
|
||||
MaiB.JP.Add(new Joi(MaiB.OP.GetCenter()));
|
||||
Mai = new Tex("Tex1", vector2D, num2, num3 * 0.98, num4 * 0.91, new Font("MS Gothic", 1f), 0.08, 0, " ", Col.White, Col.Black, Color.Transparent, 19.0, Col.White, delegate(Tex sp)
|
||||
{
|
||||
sp.Text = sp.Text;
|
||||
});
|
||||
Mai.ParT.BasePointBase = Mai.ParT.OP.GetCenter().MulY(y);
|
||||
Mai.Position = MaiB.ToGlobal(MaiB.JP[0].Joint);
|
||||
Mai.Feed.OP.OutlineFalse();
|
||||
double num5 = num4 * 4.53;
|
||||
Mai2B = new Par();
|
||||
Mai2B.BasePointBase = Dat.Vec2DZero;
|
||||
Mai2B.PositionBase = new Vector2D(vector2D.X, 0.01);
|
||||
Mai2B.SizeBase = num2;
|
||||
Mai2B.OP.AddRange(new Out[1] { Shas.Get正方形() });
|
||||
Mai2B.OP.ScalingX(Mai2B.BasePointBase, num3);
|
||||
Mai2B.OP.ScalingY(Mai2B.BasePointBase, num5);
|
||||
Mai2B.Closed = true;
|
||||
Mai2B.BrushColor = Color.FromArgb(160, Col.Black);
|
||||
Mai2B.Hit = false;
|
||||
Mai2B.JP.Add(new Joi(Mai2B.OP.GetCenter()));
|
||||
Mai2 = new Tex("Tex3", vector2D, num2, num3 * 0.98, num5 * 0.97, new Font("MS Gothic", 1f), 0.08, 0, " ", Col.White, Col.Black, Color.Transparent, 19.0, Col.White, delegate(Tex sp)
|
||||
{
|
||||
sp.Text = sp.Text;
|
||||
});
|
||||
Mai2.ParT.BasePointBase = Mai2.ParT.OP.GetCenter().MulY(y);
|
||||
Mai2.Position = Mai2B.ToGlobal(Mai2B.JP[0].Joint);
|
||||
Mai2.Feed.OP.OutlineFalse();
|
||||
num3 = Are.LocalWidth * 0.19 / num2;
|
||||
vector2D = Are.GetPosition(1.0 - (num3 * num2 / Are.LocalWidth + 0.005), 1.0 - num4 * num2 / Are.LocalHeight).AddY(0.0 - num);
|
||||
SubB = new Par();
|
||||
SubB.BasePointBase = Dat.Vec2DZero;
|
||||
SubB.PositionBase = vector2D;
|
||||
SubB.SizeBase = num2;
|
||||
SubB.OP.AddRange(new Out[1] { Shas.Get正方形() });
|
||||
SubB.OP.ScalingX(SubB.BasePointBase, num3);
|
||||
SubB.OP.ScalingY(SubB.BasePointBase, num4);
|
||||
SubB.Closed = true;
|
||||
SubB.BrushColor = Color.FromArgb(160, Col.Black);
|
||||
SubB.Hit = false;
|
||||
SubB.JP.Add(new Joi(SubB.OP.GetCenter()));
|
||||
Sub = new Tex("Tex4", vector2D, num2 * 1.01, num3 * 0.98, num4 * 0.91, new Font("MS Gothic", 1f), 0.07, 0, " ", Col.White, Col.Black, Color.Transparent, 15.0);
|
||||
Sub.ParT.BasePointBase = Sub.ParT.OP.GetCenter().MulY(y);
|
||||
Sub.Position = SubB.ToGlobal(SubB.JP[0].Joint);
|
||||
SubInnfo_l = new Lab(Med, Are, "SubInfo", vector2D, num2, 1.0, new Font("MS Gothic", 1f), 0.07, "Sub Info.", Col.White, Col.Black, Color.FromArgb(160, Col.Black), Col.Empty, Input: false);
|
||||
SubInnfo_l.ParT.PositionBase = SubInnfo_l.ParT.PositionBase.AddY((0.0 - SubInnfo_l.ParT.OP[0].ps[3].Y) * SubInnfo_l.ParT.SizeBase);
|
||||
Sub2B = new Par();
|
||||
Sub2B.BasePointBase = Dat.Vec2DZero;
|
||||
Sub2B.PositionBase = new Vector2D(0.0025, vector2D.Y);
|
||||
Sub2B.SizeBase = num2;
|
||||
Sub2B.OP.AddRange(new Out[1] { Shas.Get正方形() });
|
||||
Sub2B.OP.ScalingX(Sub2B.BasePointBase, num3);
|
||||
Sub2B.OP.ScalingY(Sub2B.BasePointBase, num4);
|
||||
Sub2B.Closed = true;
|
||||
Sub2B.BrushColor = Color.FromArgb(160, Col.Black);
|
||||
Sub2B.Hit = false;
|
||||
Sub2B.JP.Add(new Joi(SubB.OP.GetCenter()));
|
||||
Sub2 = new Tex("Tex3", Sub2B.PositionBase, num2 * 1.01, num3 * 0.98, num4 * 0.91, new Font("MS Gothic", 1f), 0.07, 0, "", Col.White, Col.Black, Color.Transparent, 15.0);
|
||||
Sub2.ParT.BasePointBase = Sub2.ParT.OP.GetCenter().MulY(y);
|
||||
Sub2.Position = Sub2B.ToGlobal(Sub2B.JP[0].Joint);
|
||||
yp = new ParT();
|
||||
yp.Text = "・" + GameText.はい;
|
||||
yp.SizeBase = Mai.ParT.SizeBase;
|
||||
yp.Font = new Font("MS Gothic", 1f);
|
||||
yp.FontSize = Mai.ParT.FontSize;
|
||||
yp.SetStringRectOutline(Are.Unit, Are.GD);
|
||||
yp.RectSize = new Vector2D(yp.OP[0].ps[1].X, yp.OP[0].ps[2].Y);
|
||||
yp.OP.ScalingY(yp.BasePointBase, 0.9);
|
||||
yp.OP.OutlineFalse();
|
||||
yp.Closed = true;
|
||||
yp.TextColor = Col.White;
|
||||
yp.BrushColor = Color.FromArgb(0, Col.Black);
|
||||
yp.ShadBrush = new SolidBrush(Col.Black);
|
||||
yp.StringFormat.Alignment = StringAlignment.Center;
|
||||
yp.StringFormat.LineAlignment = StringAlignment.Center;
|
||||
yp.PositionBase = new Vector2D(MaiB.Position.X + 0.001, MaiB.Position.Y);
|
||||
yp.Dra = false;
|
||||
yb = new But1(yp, delegate
|
||||
{
|
||||
});
|
||||
np = new ParT();
|
||||
np.Text = "・" + GameText.いいえ;
|
||||
np.SizeBase = Mai.ParT.SizeBase;
|
||||
np.Font = new Font("MS Gothic", 1f);
|
||||
np.FontSize = Mai.ParT.FontSize;
|
||||
np.SetStringRectOutline(Are.Unit, Are.GD);
|
||||
np.RectSize = new Vector2D(np.OP[0].ps[1].X, np.OP[0].ps[2].Y);
|
||||
np.OP.ScalingY(np.BasePointBase, 0.9);
|
||||
np.OP.OutlineFalse();
|
||||
np.Closed = true;
|
||||
np.TextColor = Col.White;
|
||||
np.BrushColor = Color.FromArgb(0, Col.Black);
|
||||
np.ShadBrush = new SolidBrush(Col.Black);
|
||||
np.StringFormat.Alignment = StringAlignment.Center;
|
||||
np.StringFormat.LineAlignment = StringAlignment.Center;
|
||||
np.PositionBase = new Vector2D(MaiB.Position.X + 0.001, MaiB.Position.Y);
|
||||
np.Dra = false;
|
||||
nb = new But1(np, delegate
|
||||
{
|
||||
});
|
||||
}
|
||||
public InfoPanel(Med Med, Are Are)
|
||||
{
|
||||
this.Med = Med;
|
||||
this.Are = Are;
|
||||
double num = 0.015;
|
||||
double num2 = 0.1;
|
||||
double num3 = Are.LocalWidth * 0.6 / num2;
|
||||
double num4 = Are.LocalHeight * (1.0 / 6.0) / num2;
|
||||
Vector2D vector2D = Are.GetPosition(0.2, 1.0 - num4 * num2 / Are.LocalHeight).AddY(0.0 - num);
|
||||
double y = 1.01;
|
||||
MaiB = new Par();
|
||||
MaiB.BasePointBase = Dat.Vec2DZero;
|
||||
MaiB.PositionBase = vector2D;
|
||||
MaiB.SizeBase = num2;
|
||||
MaiB.OP.AddRange(new Out[1] { Shas.Get正方形() });
|
||||
MaiB.OP.ScalingX(MaiB.BasePointBase, num3);
|
||||
MaiB.OP.ScalingY(MaiB.BasePointBase, num4);
|
||||
MaiB.Closed = true;
|
||||
MaiB.BrushColor = Color.FromArgb(160, Col.Black);
|
||||
MaiB.Hit = false;
|
||||
MaiB.JP.Add(new Joi(MaiB.OP.GetCenter()));
|
||||
Mai = new Tex("Tex1", vector2D, num2, num3 * 0.98, num4 * 0.91, new Font("MS Gothic", 1f), 0.08, 0, " ", Col.White, Col.Black, Color.Transparent, 19.0, Col.White, delegate(Tex sp)
|
||||
{
|
||||
sp.Text = sp.Text;
|
||||
});
|
||||
Mai.ParT.BasePointBase = Mai.ParT.OP.GetCenter().MulY(y);
|
||||
Mai.Position = MaiB.ToGlobal(MaiB.JP[0].Joint);
|
||||
Mai.Feed.OP.OutlineFalse();
|
||||
double num5 = num4 * 4.53;
|
||||
Mai2B = new Par();
|
||||
Mai2B.BasePointBase = Dat.Vec2DZero;
|
||||
Mai2B.PositionBase = new Vector2D(vector2D.X, 0.01);
|
||||
Mai2B.SizeBase = num2;
|
||||
Mai2B.OP.AddRange(new Out[1] { Shas.Get正方形() });
|
||||
Mai2B.OP.ScalingX(Mai2B.BasePointBase, num3);
|
||||
Mai2B.OP.ScalingY(Mai2B.BasePointBase, num5);
|
||||
Mai2B.Closed = true;
|
||||
Mai2B.BrushColor = Color.FromArgb(160, Col.Black);
|
||||
Mai2B.Hit = false;
|
||||
Mai2B.JP.Add(new Joi(Mai2B.OP.GetCenter()));
|
||||
Mai2 = new Tex("Tex3", vector2D, num2, num3 * 0.98, num5 * 0.97, new Font("MS Gothic", 1f), 0.08, 0, " ", Col.White, Col.Black, Color.Transparent, 19.0, Col.White, delegate(Tex sp)
|
||||
{
|
||||
sp.Text = sp.Text;
|
||||
});
|
||||
Mai2.ParT.BasePointBase = Mai2.ParT.OP.GetCenter().MulY(y);
|
||||
Mai2.Position = Mai2B.ToGlobal(Mai2B.JP[0].Joint);
|
||||
Mai2.Feed.OP.OutlineFalse();
|
||||
num3 = Are.LocalWidth * 0.19 / num2;
|
||||
vector2D = Are.GetPosition(1.0 - (num3 * num2 / Are.LocalWidth + 0.005), 1.0 - num4 * num2 / Are.LocalHeight).AddY(0.0 - num);
|
||||
SubB = new Par();
|
||||
SubB.BasePointBase = Dat.Vec2DZero;
|
||||
SubB.PositionBase = vector2D;
|
||||
SubB.SizeBase = num2;
|
||||
SubB.OP.AddRange(new Out[1] { Shas.Get正方形() });
|
||||
SubB.OP.ScalingX(SubB.BasePointBase, num3);
|
||||
SubB.OP.ScalingY(SubB.BasePointBase, num4);
|
||||
SubB.Closed = true;
|
||||
SubB.BrushColor = Color.FromArgb(160, Col.Black);
|
||||
SubB.Hit = false;
|
||||
SubB.JP.Add(new Joi(SubB.OP.GetCenter()));
|
||||
Sub = new Tex("Tex4", vector2D, num2 * 1.01, num3 * 0.98, num4 * 0.91, new Font("MS Gothic", 1f), 0.07, 0, " ", Col.White, Col.Black, Color.Transparent, 15.0);
|
||||
Sub.ParT.BasePointBase = Sub.ParT.OP.GetCenter().MulY(y);
|
||||
Sub.Position = SubB.ToGlobal(SubB.JP[0].Joint);
|
||||
SubInnfo_l = new Lab(Med, Are, "SubInfo", vector2D, num2, 1.0, new Font("MS Gothic", 1f), 0.07, "Sub Info.", Col.White, Col.Black, Color.FromArgb(160, Col.Black), Col.Empty, Input: false);
|
||||
SubInnfo_l.ParT.PositionBase = SubInnfo_l.ParT.PositionBase.AddY((0.0 - SubInnfo_l.ParT.OP[0].ps[3].Y) * SubInnfo_l.ParT.SizeBase);
|
||||
Sub2B = new Par();
|
||||
Sub2B.BasePointBase = Dat.Vec2DZero;
|
||||
Sub2B.PositionBase = new Vector2D(0.0025, vector2D.Y);
|
||||
Sub2B.SizeBase = num2;
|
||||
Sub2B.OP.AddRange(new Out[1] { Shas.Get正方形() });
|
||||
Sub2B.OP.ScalingX(Sub2B.BasePointBase, num3);
|
||||
Sub2B.OP.ScalingY(Sub2B.BasePointBase, num4);
|
||||
Sub2B.Closed = true;
|
||||
Sub2B.BrushColor = Color.FromArgb(160, Col.Black);
|
||||
Sub2B.Hit = false;
|
||||
Sub2B.JP.Add(new Joi(SubB.OP.GetCenter()));
|
||||
Sub2 = new Tex("Tex3", Sub2B.PositionBase, num2 * 1.01, num3 * 0.98, num4 * 0.91, new Font("MS Gothic", 1f), 0.07, 0, "", Col.White, Col.Black, Color.Transparent, 15.0);
|
||||
Sub2.ParT.BasePointBase = Sub2.ParT.OP.GetCenter().MulY(y);
|
||||
Sub2.Position = Sub2B.ToGlobal(Sub2B.JP[0].Joint);
|
||||
yp = new ParT();
|
||||
yp.Text = "・" + GameText.はい;
|
||||
yp.SizeBase = Mai.ParT.SizeBase;
|
||||
yp.Font = new Font("MS Gothic", 1f);
|
||||
yp.FontSize = Mai.ParT.FontSize;
|
||||
yp.SetStringRectOutline(Are.Unit, Are.GD);
|
||||
yp.RectSize = new Vector2D(yp.OP[0].ps[1].X, yp.OP[0].ps[2].Y);
|
||||
yp.OP.ScalingY(yp.BasePointBase, 0.9);
|
||||
yp.OP.OutlineFalse();
|
||||
yp.Closed = true;
|
||||
yp.TextColor = Col.White;
|
||||
yp.BrushColor = Color.FromArgb(0, Col.Black);
|
||||
yp.ShadBrush = new SolidBrush(Col.Black);
|
||||
yp.StringFormat.Alignment = StringAlignment.Center;
|
||||
yp.StringFormat.LineAlignment = StringAlignment.Center;
|
||||
yp.PositionBase = new Vector2D(MaiB.Position.X + 0.001, MaiB.Position.Y);
|
||||
yp.Dra = false;
|
||||
yb = new But1(yp, delegate
|
||||
{
|
||||
});
|
||||
np = new ParT();
|
||||
np.Text = "・" + GameText.いいえ;
|
||||
np.SizeBase = Mai.ParT.SizeBase;
|
||||
np.Font = new Font("MS Gothic", 1f);
|
||||
np.FontSize = Mai.ParT.FontSize;
|
||||
np.SetStringRectOutline(Are.Unit, Are.GD);
|
||||
np.RectSize = new Vector2D(np.OP[0].ps[1].X, np.OP[0].ps[2].Y);
|
||||
np.OP.ScalingY(np.BasePointBase, 0.9);
|
||||
np.OP.OutlineFalse();
|
||||
np.Closed = true;
|
||||
np.TextColor = Col.White;
|
||||
np.BrushColor = Color.FromArgb(0, Col.Black);
|
||||
np.ShadBrush = new SolidBrush(Col.Black);
|
||||
np.StringFormat.Alignment = StringAlignment.Center;
|
||||
np.StringFormat.LineAlignment = StringAlignment.Center;
|
||||
np.PositionBase = new Vector2D(MaiB.Position.X + 0.001, MaiB.Position.Y);
|
||||
np.Dra = false;
|
||||
nb = new But1(np, delegate
|
||||
{
|
||||
});
|
||||
}
|
||||
|
||||
public void SetHitColor(Med Med)
|
||||
{
|
||||
Mai.SetHitColor(Med);
|
||||
Sub.SetHitColor(Med);
|
||||
SubInnfo_l.SetHitColor(Med);
|
||||
Mai2.SetHitColor(Med);
|
||||
Sub2.SetHitColor(Med);
|
||||
yb.SetHitColor(Med);
|
||||
nb.SetHitColor(Med);
|
||||
}
|
||||
public void SetHitColor(Med Med)
|
||||
{
|
||||
Mai.SetHitColor(Med);
|
||||
Sub.SetHitColor(Med);
|
||||
SubInnfo_l.SetHitColor(Med);
|
||||
Mai2.SetHitColor(Med);
|
||||
Sub2.SetHitColor(Med);
|
||||
yb.SetHitColor(Med);
|
||||
nb.SetHitColor(Med);
|
||||
}
|
||||
|
||||
public void UpdateSub2()
|
||||
{
|
||||
Sub2.TextIm = GameText.所持金 + "\r\n" + Sta.GameData.所持金.ToString("#,0") + "\r\n" + GameText.借金 + "\r\n" + Sta.GameData.借金.ToString("#,0") + "\r\n" + Sta.GameData.日数 + GameText.日目 + "/" + Sta.GameData.時間帯;
|
||||
}
|
||||
public void UpdateSub2()
|
||||
{
|
||||
Sub2.TextIm = GameText.所持金 + "\r\n" + Sta.GameData.所持金.ToString("#,0") + "\r\n" + GameText.借金 + "\r\n" + Sta.GameData.借金.ToString("#,0") + "\r\n" + Sta.GameData.日数 + GameText.日目 + "/" + Sta.GameData.時間帯;
|
||||
}
|
||||
|
||||
private void SetButPos()
|
||||
{
|
||||
yp.PositionBase = new Vector2D(yp.PositionBase.X, Mai.ParT.ToGlobal(Mai.ParT.GetStringRect(Are.Unit, Are.GD).v2).Y + 0.0025);
|
||||
np.PositionBase = new Vector2D(np.PositionBase.X, yp.ToGlobal(yp.OP.Last().ps.Last()).Y + 0.0025);
|
||||
}
|
||||
private void SetButPos()
|
||||
{
|
||||
yp.PositionBase = new Vector2D(yp.PositionBase.X, Mai.ParT.ToGlobal(Mai.ParT.GetStringRect(Are.Unit, Are.GD).v2).Y + 0.0025);
|
||||
np.PositionBase = new Vector2D(np.PositionBase.X, yp.ToGlobal(yp.OP.Last().ps.Last()).Y + 0.0025);
|
||||
}
|
||||
|
||||
public void Move(ref Color HitColor)
|
||||
{
|
||||
yb.Move(ref HitColor);
|
||||
nb.Move(ref HitColor);
|
||||
}
|
||||
public void Move(ref Color HitColor)
|
||||
{
|
||||
yb.Move(ref HitColor);
|
||||
nb.Move(ref HitColor);
|
||||
}
|
||||
|
||||
public void Down(ref Color HitColor)
|
||||
{
|
||||
Sub.Down(ref HitColor);
|
||||
yb.Down(ref HitColor);
|
||||
nb.Down(ref HitColor);
|
||||
}
|
||||
public void Down(ref Color HitColor)
|
||||
{
|
||||
Sub.Down(ref HitColor);
|
||||
yb.Down(ref HitColor);
|
||||
nb.Down(ref HitColor);
|
||||
}
|
||||
|
||||
public void DownB(ref Color HitColor)
|
||||
{
|
||||
yb.Down(ref HitColor);
|
||||
nb.Down(ref HitColor);
|
||||
}
|
||||
public void DownB(ref Color HitColor)
|
||||
{
|
||||
yb.Down(ref HitColor);
|
||||
nb.Down(ref HitColor);
|
||||
}
|
||||
|
||||
public void Up(ref Color HitColor)
|
||||
{
|
||||
Sub.Up(ref HitColor);
|
||||
yb.Up(ref HitColor);
|
||||
nb.Up(ref HitColor);
|
||||
}
|
||||
public void Up(ref Color HitColor)
|
||||
{
|
||||
Sub.Up(ref HitColor);
|
||||
yb.Up(ref HitColor);
|
||||
nb.Up(ref HitColor);
|
||||
}
|
||||
|
||||
public void Draw(Are Are, FPS FPS)
|
||||
{
|
||||
if (MaiShow)
|
||||
{
|
||||
Are.Draw(MaiB);
|
||||
Mai.Progression(FPS);
|
||||
Are.Draw(Mai.Pars);
|
||||
}
|
||||
if (Mai2Show)
|
||||
{
|
||||
Are.Draw(Mai2B);
|
||||
Are.Draw(Mai2.Pars);
|
||||
}
|
||||
if (SubShow)
|
||||
{
|
||||
Are.Draw(SubB);
|
||||
Sub.Progression(FPS);
|
||||
Are.Draw(Sub.Pars);
|
||||
Are.Draw(SubInnfo_l.ParT);
|
||||
}
|
||||
if (Sub2Show)
|
||||
{
|
||||
Are.Draw(Sub2B);
|
||||
Are.Draw(Sub2.Pars);
|
||||
}
|
||||
if (yp.Dra)
|
||||
{
|
||||
Are.Draw(yp);
|
||||
}
|
||||
if (np.Dra)
|
||||
{
|
||||
Are.Draw(np);
|
||||
}
|
||||
}
|
||||
public void Draw(Are Are, FPS FPS)
|
||||
{
|
||||
if (MaiShow)
|
||||
{
|
||||
Are.Draw(MaiB);
|
||||
Mai.Progression(FPS);
|
||||
Are.Draw(Mai.Pars);
|
||||
}
|
||||
if (Mai2Show)
|
||||
{
|
||||
Are.Draw(Mai2B);
|
||||
Are.Draw(Mai2.Pars);
|
||||
}
|
||||
if (SubShow)
|
||||
{
|
||||
Are.Draw(SubB);
|
||||
Sub.Progression(FPS);
|
||||
Are.Draw(Sub.Pars);
|
||||
Are.Draw(SubInnfo_l.ParT);
|
||||
}
|
||||
if (Sub2Show)
|
||||
{
|
||||
Are.Draw(Sub2B);
|
||||
Are.Draw(Sub2.Pars);
|
||||
}
|
||||
if (yp.Dra)
|
||||
{
|
||||
Are.Draw(yp);
|
||||
}
|
||||
if (np.Dra)
|
||||
{
|
||||
Are.Draw(np);
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
MaiB.Dispose();
|
||||
Mai.Dispose();
|
||||
Mai2B.Dispose();
|
||||
Mai2.Dispose();
|
||||
SubB.Dispose();
|
||||
Sub.Dispose();
|
||||
SubInnfo_l.Dispose();
|
||||
Sub2B.Dispose();
|
||||
Sub2.Dispose();
|
||||
}
|
||||
public void Dispose()
|
||||
{
|
||||
MaiB.Dispose();
|
||||
Mai.Dispose();
|
||||
Mai2B.Dispose();
|
||||
Mai2.Dispose();
|
||||
SubB.Dispose();
|
||||
Sub.Dispose();
|
||||
SubInnfo_l.Dispose();
|
||||
Sub2B.Dispose();
|
||||
Sub2.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,110 +3,111 @@ using System.Drawing;
|
||||
using System.Linq;
|
||||
using _2DGAMELIB;
|
||||
|
||||
namespace SlaveMatrix;
|
||||
|
||||
public struct sep
|
||||
namespace SlaveMatrix
|
||||
{
|
||||
public Ele Sta;
|
||||
public struct sep
|
||||
{
|
||||
public Ele Sta;
|
||||
|
||||
public Ele Ele;
|
||||
public Ele Ele;
|
||||
|
||||
public Par Par;
|
||||
public Par Par;
|
||||
|
||||
public List<int> Path;
|
||||
public List<int> Path;
|
||||
|
||||
public Vector2D Pos;
|
||||
}
|
||||
|
||||
//three subclasses: one for bukkake, kiss marks, and whip marks
|
||||
public class Stamp
|
||||
{
|
||||
public Med Med;
|
||||
|
||||
public Are Are;
|
||||
|
||||
public Cha Cha;
|
||||
|
||||
public Bod Bod;
|
||||
|
||||
protected EleD EleD;
|
||||
|
||||
protected List<sep> sta = new List<sep>();
|
||||
|
||||
protected const int Max = 33;
|
||||
|
||||
protected Par p;
|
||||
|
||||
protected Color2 c2;
|
||||
|
||||
protected Ele he;
|
||||
|
||||
protected sep sep;
|
||||
|
||||
public virtual void Draw(Are Are)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void Add(Vector2D cp, Color hc)
|
||||
{
|
||||
}
|
||||
|
||||
public Stamp()
|
||||
{
|
||||
}
|
||||
|
||||
public Stamp(Med Med, Are Are, Cha Cha, Bod Bod, EleD EleD)
|
||||
{
|
||||
this.Med = Med;
|
||||
this.Are = Are;
|
||||
this.Cha = Cha;
|
||||
this.Bod = Bod;
|
||||
this.EleD = EleD;
|
||||
}
|
||||
|
||||
public virtual void Dispose()
|
||||
{
|
||||
foreach (sep stum in sta)
|
||||
{
|
||||
stum.Sta.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
foreach (sep stum in sta)
|
||||
{
|
||||
stum.Sta.Dispose();
|
||||
}
|
||||
sta.Clear();
|
||||
}
|
||||
|
||||
public void 脚Clear()
|
||||
{
|
||||
sep[] array = sta.Where((sep e) => e.Ele is 腿_人 || e.Ele is 脚_人 || e.Ele is 足_人).ToArray();
|
||||
for (int i = 0; i < array.Length; i++)
|
||||
{
|
||||
sep item = array[i];
|
||||
item.Sta.Dispose();
|
||||
sta.Remove(item);
|
||||
}
|
||||
}
|
||||
|
||||
public bool チェック1(Ele e)
|
||||
{
|
||||
if (e != null && !(e is 性器) && !(e is 肛門))
|
||||
{
|
||||
return !(e is 首);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool チェック2(Ele e)
|
||||
{
|
||||
if (e != null && !(e is 手_人) && !(e is 性器) && !(e is 肛門))
|
||||
{
|
||||
return !(e is 首);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public Vector2D Pos;
|
||||
}
|
||||
|
||||
//three subclasses: one for bukkake, kiss marks, and whip marks
|
||||
public class Stamp
|
||||
{
|
||||
public Med Med;
|
||||
|
||||
public Are Are;
|
||||
|
||||
public Cha Cha;
|
||||
|
||||
public Bod Bod;
|
||||
|
||||
protected EleD EleD;
|
||||
|
||||
protected List<sep> sta = new List<sep>();
|
||||
|
||||
protected const int Max = 33;
|
||||
|
||||
protected Par p;
|
||||
|
||||
protected Color2 c2;
|
||||
|
||||
protected Ele he;
|
||||
|
||||
protected sep sep;
|
||||
|
||||
public virtual void Draw(Are Are)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void Add(Vector2D cp, Color hc)
|
||||
{
|
||||
}
|
||||
|
||||
public Stamp()
|
||||
{
|
||||
}
|
||||
|
||||
public Stamp(Med Med, Are Are, Cha Cha, Bod Bod, EleD EleD)
|
||||
{
|
||||
this.Med = Med;
|
||||
this.Are = Are;
|
||||
this.Cha = Cha;
|
||||
this.Bod = Bod;
|
||||
this.EleD = EleD;
|
||||
}
|
||||
|
||||
public virtual void Dispose()
|
||||
{
|
||||
foreach (sep stum in sta)
|
||||
{
|
||||
stum.Sta.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
foreach (sep stum in sta)
|
||||
{
|
||||
stum.Sta.Dispose();
|
||||
}
|
||||
sta.Clear();
|
||||
}
|
||||
|
||||
public void 脚Clear()
|
||||
{
|
||||
sep[] array = sta.Where((sep e) => e.Ele is 腿_人 || e.Ele is 脚_人 || e.Ele is 足_人).ToArray();
|
||||
for (int i = 0; i < array.Length; i++)
|
||||
{
|
||||
sep item = array[i];
|
||||
item.Sta.Dispose();
|
||||
sta.Remove(item);
|
||||
}
|
||||
}
|
||||
|
||||
public bool チェック1(Ele e)
|
||||
{
|
||||
if (e != null && !(e is 性器) && !(e is 肛門))
|
||||
{
|
||||
return !(e is 首);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool チェック2(Ele e)
|
||||
{
|
||||
if (e != null && !(e is 手_人) && !(e is 性器) && !(e is 肛門))
|
||||
{
|
||||
return !(e is 首);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,241 +2,242 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using _2DGAMELIB;
|
||||
|
||||
namespace SlaveMatrix;
|
||||
|
||||
public struct ryps
|
||||
namespace SlaveMatrix
|
||||
{
|
||||
public Par r;
|
||||
public struct ryps
|
||||
{
|
||||
public Par r;
|
||||
|
||||
public Vector2D c;
|
||||
public Vector2D c;
|
||||
|
||||
public Vector2D[] ps;
|
||||
}
|
||||
public Vector2D[] ps;
|
||||
}
|
||||
|
||||
|
||||
public class Sweat
|
||||
{
|
||||
private HashSet<string> 汗対象 = new HashSet<string>
|
||||
{
|
||||
Sta.胸t.ToString(),
|
||||
Sta.胴t.ToString(),
|
||||
Sta.肩t.ToString(),
|
||||
Sta.腰t.ToString()
|
||||
};
|
||||
public class Sweat
|
||||
{
|
||||
private HashSet<string> 汗対象 = new HashSet<string>
|
||||
{
|
||||
Sta.胸t.ToString(),
|
||||
Sta.胴t.ToString(),
|
||||
Sta.肩t.ToString(),
|
||||
Sta.腰t.ToString()
|
||||
};
|
||||
|
||||
private ryps[] 対象;
|
||||
private ryps[] 対象;
|
||||
|
||||
private List<Ele> 全体 = new List<Ele>();
|
||||
private List<Ele> 全体 = new List<Ele>();
|
||||
|
||||
private List<double> 位置 = new List<double>();
|
||||
private List<double> 位置 = new List<double>();
|
||||
|
||||
public Mot 汗かき;
|
||||
public Mot 汗かき;
|
||||
|
||||
private Mot 汗ひき;
|
||||
private Mot 汗ひき;
|
||||
|
||||
private bool 汗だし = true;
|
||||
private bool 汗だし = true;
|
||||
|
||||
private int i;
|
||||
private int i;
|
||||
|
||||
private Ele 汗;
|
||||
private Ele 汗;
|
||||
|
||||
private Vector2D tp;
|
||||
private Vector2D tp;
|
||||
|
||||
public void Draw(Are Are)
|
||||
{
|
||||
if (!汗かき.Run && !汗ひき.Run)
|
||||
{
|
||||
return;
|
||||
}
|
||||
this.i = 0;
|
||||
ryps[] array = 対象;
|
||||
for (int i = 0; i < array.Length; i++)
|
||||
{
|
||||
ryps ryps2 = array[i];
|
||||
Vector2D[] ps = ryps2.ps;
|
||||
foreach (Vector2D local in ps)
|
||||
{
|
||||
汗 = 全体[this.i];
|
||||
if (汗.濃度 != 0.0)
|
||||
{
|
||||
tp = ryps2.r.ToGlobal(local);
|
||||
汗.本体.CurJoinRoot.PositionBase = tp + (ryps2.r.ToGlobal(ryps2.c) - tp) * 位置[this.i];
|
||||
汗.本体.JoinPA();
|
||||
汗.色更新();
|
||||
汗.本体.Draw(Are);
|
||||
}
|
||||
this.i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
public void Draw(Are Are)
|
||||
{
|
||||
if (!汗かき.Run && !汗ひき.Run)
|
||||
{
|
||||
return;
|
||||
}
|
||||
this.i = 0;
|
||||
ryps[] array = 対象;
|
||||
for (int i = 0; i < array.Length; i++)
|
||||
{
|
||||
ryps ryps2 = array[i];
|
||||
Vector2D[] ps = ryps2.ps;
|
||||
foreach (Vector2D local in ps)
|
||||
{
|
||||
汗 = 全体[this.i];
|
||||
if (汗.濃度 != 0.0)
|
||||
{
|
||||
tp = ryps2.r.ToGlobal(local);
|
||||
汗.本体.CurJoinRoot.PositionBase = tp + (ryps2.r.ToGlobal(ryps2.c) - tp) * 位置[this.i];
|
||||
汗.本体.JoinPA();
|
||||
汗.色更新();
|
||||
汗.本体.Draw(Are);
|
||||
}
|
||||
this.i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Sweat(Med Med, Are Are, Cha Cha, Mots Mots)
|
||||
{
|
||||
Ele[] es = null;
|
||||
Ele n = null;
|
||||
bool re = false;
|
||||
汗かき = new Mot(0.0, 1.0)
|
||||
{
|
||||
BaseSpeed = 1.0,
|
||||
Staing = delegate
|
||||
{
|
||||
if (汗だし)
|
||||
{
|
||||
es = 全体.Where((Ele e) => e.濃度 != 0.0).ToArray();
|
||||
Ele[] array5 = es;
|
||||
for (int num3 = 0; num3 < array5.Length; num3++)
|
||||
{
|
||||
array5[num3].濃度 = 0.0;
|
||||
}
|
||||
}
|
||||
},
|
||||
Runing = delegate(Mot m)
|
||||
{
|
||||
if (汗だし)
|
||||
{
|
||||
Ele[] array4 = es;
|
||||
for (int num2 = 0; num2 < array4.Length; num2++)
|
||||
{
|
||||
array4[num2].濃度 = m.Value;
|
||||
}
|
||||
}
|
||||
else if (!re)
|
||||
{
|
||||
n.Yv = m.Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
n.濃度 = m.Value;
|
||||
}
|
||||
},
|
||||
Reaing = delegate(Mot m)
|
||||
{
|
||||
if (汗だし)
|
||||
{
|
||||
Ele[] array3 = es;
|
||||
for (int l = 0; l < array3.Length; l++)
|
||||
{
|
||||
array3[l].濃度 = 1.0;
|
||||
}
|
||||
m.ResetValue();
|
||||
汗だし = false;
|
||||
es = 全体.Where((Ele e) => e.濃度 != 0.0).ToArray();
|
||||
n = es[RNG.XS.Next(es.Length)];
|
||||
}
|
||||
else
|
||||
{
|
||||
re = true;
|
||||
}
|
||||
},
|
||||
Rouing = delegate(Mot m)
|
||||
{
|
||||
if (!汗だし)
|
||||
{
|
||||
n.Yv = 0.0;
|
||||
n.濃度 = 0.0;
|
||||
es = 全体.Where((Ele e) => e.濃度 != 0.0).ToArray();
|
||||
if (es.Length != 0)
|
||||
{
|
||||
n = es[RNG.XS.Next(es.Length)];
|
||||
}
|
||||
es = 全体.Where((Ele e) => e.濃度 == 0.0).ToArray();
|
||||
if (es.Length != 0)
|
||||
{
|
||||
es[RNG.XS.Next(es.Length)].濃度 = 1.0;
|
||||
}
|
||||
re = false;
|
||||
m.ResetValue();
|
||||
}
|
||||
},
|
||||
Ending = delegate(Mot m)
|
||||
{
|
||||
if (!汗だし)
|
||||
{
|
||||
n.Yv = 0.0;
|
||||
n.濃度 = 0.0;
|
||||
es = 全体.Where((Ele e) => e.濃度 != 0.0).ToArray();
|
||||
n = es[RNG.XS.Next(es.Length)];
|
||||
es = 全体.Where((Ele e) => e.濃度 == 0.0).ToArray();
|
||||
es[RNG.XS.Next(es.Length)].濃度 = 1.0;
|
||||
re = false;
|
||||
m.ResetValue();
|
||||
汗ひき.Start();
|
||||
}
|
||||
}
|
||||
};
|
||||
Mots.Add(汗かき.GetHashCode().ToString(), 汗かき);
|
||||
汗ひき = new Mot(0.0, 1.0)
|
||||
{
|
||||
BaseSpeed = 1.0,
|
||||
Staing = delegate
|
||||
{
|
||||
es = 全体.Where((Ele e) => e.濃度 != 0.0).ToArray();
|
||||
},
|
||||
Runing = delegate(Mot m)
|
||||
{
|
||||
Ele[] array2 = es;
|
||||
for (int k = 0; k < array2.Length; k++)
|
||||
{
|
||||
array2[k].濃度 = m.Value.Inverse();
|
||||
}
|
||||
},
|
||||
Reaing = delegate(Mot m)
|
||||
{
|
||||
m.End();
|
||||
m.ResetValue();
|
||||
Ele[] array = es;
|
||||
for (int j = 0; j < array.Length; j++)
|
||||
{
|
||||
array[j].濃度 = 1.0;
|
||||
}
|
||||
汗だし = true;
|
||||
},
|
||||
Rouing = delegate
|
||||
{
|
||||
},
|
||||
Ending = delegate
|
||||
{
|
||||
}
|
||||
};
|
||||
Mots.Add(汗ひき.GetHashCode().ToString(), 汗ひき);
|
||||
List<ryps> list = new List<ryps>();
|
||||
int num = 0;
|
||||
汗D e2 = new 汗D();
|
||||
ryps ryps;
|
||||
foreach (Ele item in Cha.Bod.Elements.Where((Ele e) => 汗対象.Contains(e.GetType().ToString())))
|
||||
{
|
||||
ryps = default(ryps);
|
||||
ryps.r = item.本体.CurJoinRoot;
|
||||
ryps.c = ryps.r.OP.GetCenter();
|
||||
ryps.ps = (from p in ryps.r.OP.EnumPoints()
|
||||
where ryps.c.Y > p.Y
|
||||
select p).ToArray();
|
||||
list.Add(ryps);
|
||||
Vector2D[] ps = ryps.ps;
|
||||
for (int i = 0; i < ps.Length; i++)
|
||||
{
|
||||
_ = ref ps[i];
|
||||
汗 = new 汗(Are.DisUnit, 配色指定.N0, Cha.配色, Med, e2);
|
||||
汗.SetHitFalse();
|
||||
汗.濃度 = ((RNG.XS.NextDouble() < 0.2) ? 1.0 : 0.0);
|
||||
位置.Add(num switch
|
||||
{
|
||||
1 => 0.5,
|
||||
0 => 0.7,
|
||||
_ => 0.3,
|
||||
});
|
||||
全体.Add(汗);
|
||||
num = ((num != 2) ? (num + 1) : 0);
|
||||
}
|
||||
}
|
||||
対象 = list.ToArray();
|
||||
}
|
||||
public Sweat(Med Med, Are Are, Cha Cha, Mots Mots)
|
||||
{
|
||||
Ele[] es = null;
|
||||
Ele n = null;
|
||||
bool re = false;
|
||||
汗かき = new Mot(0.0, 1.0)
|
||||
{
|
||||
BaseSpeed = 1.0,
|
||||
Staing = delegate
|
||||
{
|
||||
if (汗だし)
|
||||
{
|
||||
es = 全体.Where((Ele e) => e.濃度 != 0.0).ToArray();
|
||||
Ele[] array5 = es;
|
||||
for (int num3 = 0; num3 < array5.Length; num3++)
|
||||
{
|
||||
array5[num3].濃度 = 0.0;
|
||||
}
|
||||
}
|
||||
},
|
||||
Runing = delegate(Mot m)
|
||||
{
|
||||
if (汗だし)
|
||||
{
|
||||
Ele[] array4 = es;
|
||||
for (int num2 = 0; num2 < array4.Length; num2++)
|
||||
{
|
||||
array4[num2].濃度 = m.Value;
|
||||
}
|
||||
}
|
||||
else if (!re)
|
||||
{
|
||||
n.Yv = m.Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
n.濃度 = m.Value;
|
||||
}
|
||||
},
|
||||
Reaing = delegate(Mot m)
|
||||
{
|
||||
if (汗だし)
|
||||
{
|
||||
Ele[] array3 = es;
|
||||
for (int l = 0; l < array3.Length; l++)
|
||||
{
|
||||
array3[l].濃度 = 1.0;
|
||||
}
|
||||
m.ResetValue();
|
||||
汗だし = false;
|
||||
es = 全体.Where((Ele e) => e.濃度 != 0.0).ToArray();
|
||||
n = es[RNG.XS.Next(es.Length)];
|
||||
}
|
||||
else
|
||||
{
|
||||
re = true;
|
||||
}
|
||||
},
|
||||
Rouing = delegate(Mot m)
|
||||
{
|
||||
if (!汗だし)
|
||||
{
|
||||
n.Yv = 0.0;
|
||||
n.濃度 = 0.0;
|
||||
es = 全体.Where((Ele e) => e.濃度 != 0.0).ToArray();
|
||||
if (es.Length != 0)
|
||||
{
|
||||
n = es[RNG.XS.Next(es.Length)];
|
||||
}
|
||||
es = 全体.Where((Ele e) => e.濃度 == 0.0).ToArray();
|
||||
if (es.Length != 0)
|
||||
{
|
||||
es[RNG.XS.Next(es.Length)].濃度 = 1.0;
|
||||
}
|
||||
re = false;
|
||||
m.ResetValue();
|
||||
}
|
||||
},
|
||||
Ending = delegate(Mot m)
|
||||
{
|
||||
if (!汗だし)
|
||||
{
|
||||
n.Yv = 0.0;
|
||||
n.濃度 = 0.0;
|
||||
es = 全体.Where((Ele e) => e.濃度 != 0.0).ToArray();
|
||||
n = es[RNG.XS.Next(es.Length)];
|
||||
es = 全体.Where((Ele e) => e.濃度 == 0.0).ToArray();
|
||||
es[RNG.XS.Next(es.Length)].濃度 = 1.0;
|
||||
re = false;
|
||||
m.ResetValue();
|
||||
汗ひき.Start();
|
||||
}
|
||||
}
|
||||
};
|
||||
Mots.Add(汗かき.GetHashCode().ToString(), 汗かき);
|
||||
汗ひき = new Mot(0.0, 1.0)
|
||||
{
|
||||
BaseSpeed = 1.0,
|
||||
Staing = delegate
|
||||
{
|
||||
es = 全体.Where((Ele e) => e.濃度 != 0.0).ToArray();
|
||||
},
|
||||
Runing = delegate(Mot m)
|
||||
{
|
||||
Ele[] array2 = es;
|
||||
for (int k = 0; k < array2.Length; k++)
|
||||
{
|
||||
array2[k].濃度 = m.Value.Inverse();
|
||||
}
|
||||
},
|
||||
Reaing = delegate(Mot m)
|
||||
{
|
||||
m.End();
|
||||
m.ResetValue();
|
||||
Ele[] array = es;
|
||||
for (int j = 0; j < array.Length; j++)
|
||||
{
|
||||
array[j].濃度 = 1.0;
|
||||
}
|
||||
汗だし = true;
|
||||
},
|
||||
Rouing = delegate
|
||||
{
|
||||
},
|
||||
Ending = delegate
|
||||
{
|
||||
}
|
||||
};
|
||||
Mots.Add(汗ひき.GetHashCode().ToString(), 汗ひき);
|
||||
List<ryps> list = new List<ryps>();
|
||||
int num = 0;
|
||||
汗D e2 = new 汗D();
|
||||
ryps ryps;
|
||||
foreach (Ele item in Cha.Bod.Elements.Where((Ele e) => 汗対象.Contains(e.GetType().ToString())))
|
||||
{
|
||||
ryps = default(ryps);
|
||||
ryps.r = item.本体.CurJoinRoot;
|
||||
ryps.c = ryps.r.OP.GetCenter();
|
||||
ryps.ps = (from p in ryps.r.OP.EnumPoints()
|
||||
where ryps.c.Y > p.Y
|
||||
select p).ToArray();
|
||||
list.Add(ryps);
|
||||
Vector2D[] ps = ryps.ps;
|
||||
for (int i = 0; i < ps.Length; i++)
|
||||
{
|
||||
_ = ref ps[i];
|
||||
汗 = new 汗(Are.DisUnit, 配色指定.N0, Cha.配色, Med, e2);
|
||||
汗.SetHitFalse();
|
||||
汗.濃度 = ((RNG.XS.NextDouble() < 0.2) ? 1.0 : 0.0);
|
||||
位置.Add(num switch
|
||||
{
|
||||
1 => 0.5,
|
||||
0 => 0.7,
|
||||
_ => 0.3,
|
||||
});
|
||||
全体.Add(汗);
|
||||
num = ((num != 2) ? (num + 1) : 0);
|
||||
}
|
||||
}
|
||||
対象 = list.ToArray();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
foreach (Ele item in 全体)
|
||||
{
|
||||
item.Dispose();
|
||||
}
|
||||
}
|
||||
public void Dispose()
|
||||
{
|
||||
foreach (Ele item in 全体)
|
||||
{
|
||||
item.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,58 +1,59 @@
|
||||
using System;
|
||||
using _2DGAMELIB;
|
||||
|
||||
namespace SlaveMatrix;
|
||||
|
||||
[Serializable]
|
||||
public class T剃刀D : EleD
|
||||
namespace SlaveMatrix
|
||||
{
|
||||
public bool ヘッド_表示 = true;
|
||||
[Serializable]
|
||||
public class T剃刀D : EleD
|
||||
{
|
||||
public bool ヘッド_表示 = true;
|
||||
|
||||
public bool 刃_刃1_表示 = true;
|
||||
public bool 刃_刃1_表示 = true;
|
||||
|
||||
public bool 刃_刃2_表示 = true;
|
||||
public bool 刃_刃2_表示 = true;
|
||||
|
||||
public bool 首_表示 = true;
|
||||
public bool 首_表示 = true;
|
||||
|
||||
public bool グリップ_グリップ0_表示 = true;
|
||||
public bool グリップ_グリップ0_表示 = true;
|
||||
|
||||
public bool グリップ_グリップ1_表示 = true;
|
||||
public bool グリップ_グリップ1_表示 = true;
|
||||
|
||||
public bool グリップ_グリップ2_表示 = true;
|
||||
public bool グリップ_グリップ2_表示 = true;
|
||||
|
||||
public bool グリップ_グリップ3_表示 = true;
|
||||
public bool グリップ_グリップ3_表示 = true;
|
||||
|
||||
public bool グリップ_グリップ4_表示 = true;
|
||||
public bool グリップ_グリップ4_表示 = true;
|
||||
|
||||
public bool グリップ_グリップ5_表示 = true;
|
||||
public bool グリップ_グリップ5_表示 = true;
|
||||
|
||||
public bool グリップ_グリップ6_表示 = true;
|
||||
public bool グリップ_グリップ6_表示 = true;
|
||||
|
||||
public bool グリップ_グリップ7_表示 = true;
|
||||
public bool グリップ_グリップ7_表示 = true;
|
||||
|
||||
public bool グリップ_グリップ8_表示 = true;
|
||||
public bool グリップ_グリップ8_表示 = true;
|
||||
|
||||
public bool グリップ_グリップ9_表示 = true;
|
||||
public bool グリップ_グリップ9_表示 = true;
|
||||
|
||||
public bool グリップ_グリップ10_表示 = true;
|
||||
public bool グリップ_グリップ10_表示 = true;
|
||||
|
||||
public bool グリップ_グリップ11_表示 = true;
|
||||
public bool グリップ_グリップ11_表示 = true;
|
||||
|
||||
public bool グリップ_グリップ12_表示 = true;
|
||||
public bool グリップ_グリップ12_表示 = true;
|
||||
|
||||
public bool グリップ_グリップ13_表示 = true;
|
||||
public bool グリップ_グリップ13_表示 = true;
|
||||
|
||||
public bool グリップ_グリップ14_表示 = true;
|
||||
public bool グリップ_グリップ14_表示 = true;
|
||||
|
||||
public bool グリップ_グリップ15_表示 = true;
|
||||
public bool グリップ_グリップ15_表示 = true;
|
||||
|
||||
public T剃刀D()
|
||||
{
|
||||
ThisType = GetType();
|
||||
}
|
||||
public T剃刀D()
|
||||
{
|
||||
ThisType = GetType();
|
||||
}
|
||||
|
||||
public override Ele GetEle(double DisUnit, Med Med, 体配色 体配色)
|
||||
{
|
||||
return new T剃刀(DisUnit, 配色指定, 体配色, Med, this);
|
||||
}
|
||||
public override Ele GetEle(double DisUnit, Med Med, 体配色 体配色)
|
||||
{
|
||||
return new T剃刀(DisUnit, 配色指定, 体配色, Med, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
namespace SlaveMatrix;
|
||||
|
||||
public enum UsageStatus
|
||||
namespace SlaveMatrix
|
||||
{
|
||||
Standby,
|
||||
InUse,
|
||||
Attach
|
||||
public enum UsageStatus
|
||||
{
|
||||
Standby,
|
||||
InUse,
|
||||
Attach
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
namespace SlaveMatrix;
|
||||
|
||||
public class お下げ1 : 後髪0
|
||||
namespace SlaveMatrix
|
||||
{
|
||||
public virtual bool お下げ_髪縛1_表示 { get; set; }
|
||||
public class お下げ1 : 後髪0
|
||||
{
|
||||
public virtual bool お下げ_髪縛1_表示 { get; set; }
|
||||
|
||||
public virtual bool お下げ_髪縛2_表示 { get; set; }
|
||||
public virtual bool お下げ_髪縛2_表示 { get; set; }
|
||||
|
||||
public virtual void 髪留配色(髪留色 配色)
|
||||
{
|
||||
}
|
||||
public virtual void 髪留配色(髪留色 配色)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
using System;
|
||||
|
||||
namespace SlaveMatrix;
|
||||
|
||||
[Serializable]
|
||||
public class お下げ1D : 後髪0D
|
||||
namespace SlaveMatrix
|
||||
{
|
||||
[Serializable]
|
||||
public class お下げ1D : 後髪0D
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
namespace SlaveMatrix;
|
||||
|
||||
public class お下げ2 : 後髪0
|
||||
namespace SlaveMatrix
|
||||
{
|
||||
public virtual bool お下げ左_髪縛1_表示 { get; set; }
|
||||
public class お下げ2 : 後髪0
|
||||
{
|
||||
public virtual bool お下げ左_髪縛1_表示 { get; set; }
|
||||
|
||||
public virtual bool お下げ左_髪縛2_表示 { get; set; }
|
||||
public virtual bool お下げ左_髪縛2_表示 { get; set; }
|
||||
|
||||
public virtual bool お下げ右_髪縛1_表示 { get; set; }
|
||||
public virtual bool お下げ右_髪縛1_表示 { get; set; }
|
||||
|
||||
public virtual bool お下げ右_髪縛2_表示 { get; set; }
|
||||
public virtual bool お下げ右_髪縛2_表示 { get; set; }
|
||||
|
||||
public virtual void 髪留配色(髪留色 配色左, 髪留色 配色右)
|
||||
{
|
||||
}
|
||||
public virtual void 髪留配色(髪留色 配色左, 髪留色 配色右)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
using System;
|
||||
|
||||
namespace SlaveMatrix;
|
||||
|
||||
[Serializable]
|
||||
public class お下げ2D : 後髪0D
|
||||
namespace SlaveMatrix
|
||||
{
|
||||
[Serializable]
|
||||
public class お下げ2D : 後髪0D
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,200 +1,201 @@
|
||||
using _2DGAMELIB;
|
||||
|
||||
namespace SlaveMatrix;
|
||||
|
||||
public class ぶっかけ_大 : Ele
|
||||
namespace SlaveMatrix
|
||||
{
|
||||
public Par X0Y0_精液;
|
||||
public class ぶっかけ_大 : Ele
|
||||
{
|
||||
public Par X0Y0_精液;
|
||||
|
||||
public Par X0Y1_精液;
|
||||
public Par X0Y1_精液;
|
||||
|
||||
public Par X0Y2_精液;
|
||||
public Par X0Y2_精液;
|
||||
|
||||
public Par X0Y3_精液;
|
||||
public Par X0Y3_精液;
|
||||
|
||||
public Par X0Y4_精液;
|
||||
public Par X0Y4_精液;
|
||||
|
||||
public ColorD 精液CD;
|
||||
public ColorD 精液CD;
|
||||
|
||||
public ColorP X0Y0_精液CP;
|
||||
public ColorP X0Y0_精液CP;
|
||||
|
||||
public ColorP X0Y1_精液CP;
|
||||
public ColorP X0Y1_精液CP;
|
||||
|
||||
public ColorP X0Y2_精液CP;
|
||||
public ColorP X0Y2_精液CP;
|
||||
|
||||
public ColorP X0Y3_精液CP;
|
||||
public ColorP X0Y3_精液CP;
|
||||
|
||||
public ColorP X0Y4_精液CP;
|
||||
public ColorP X0Y4_精液CP;
|
||||
|
||||
public override bool 欠損
|
||||
{
|
||||
get
|
||||
{
|
||||
return 欠損_;
|
||||
}
|
||||
set
|
||||
{
|
||||
欠損_ = value;
|
||||
}
|
||||
}
|
||||
public override bool 欠損
|
||||
{
|
||||
get
|
||||
{
|
||||
return 欠損_;
|
||||
}
|
||||
set
|
||||
{
|
||||
欠損_ = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool 筋肉
|
||||
{
|
||||
get
|
||||
{
|
||||
return 筋肉_;
|
||||
}
|
||||
set
|
||||
{
|
||||
筋肉_ = value;
|
||||
}
|
||||
}
|
||||
public override bool 筋肉
|
||||
{
|
||||
get
|
||||
{
|
||||
return 筋肉_;
|
||||
}
|
||||
set
|
||||
{
|
||||
筋肉_ = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool 拘束
|
||||
{
|
||||
get
|
||||
{
|
||||
return 拘束_;
|
||||
}
|
||||
set
|
||||
{
|
||||
拘束_ = value;
|
||||
}
|
||||
}
|
||||
public override bool 拘束
|
||||
{
|
||||
get
|
||||
{
|
||||
return 拘束_;
|
||||
}
|
||||
set
|
||||
{
|
||||
拘束_ = value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool 精液_表示
|
||||
{
|
||||
get
|
||||
{
|
||||
return X0Y0_精液.Dra;
|
||||
}
|
||||
set
|
||||
{
|
||||
X0Y0_精液.Dra = value;
|
||||
X0Y1_精液.Dra = value;
|
||||
X0Y2_精液.Dra = value;
|
||||
X0Y3_精液.Dra = value;
|
||||
X0Y4_精液.Dra = value;
|
||||
X0Y0_精液.Hit = value;
|
||||
X0Y1_精液.Hit = value;
|
||||
X0Y2_精液.Hit = value;
|
||||
X0Y3_精液.Hit = value;
|
||||
X0Y4_精液.Hit = value;
|
||||
}
|
||||
}
|
||||
public bool 精液_表示
|
||||
{
|
||||
get
|
||||
{
|
||||
return X0Y0_精液.Dra;
|
||||
}
|
||||
set
|
||||
{
|
||||
X0Y0_精液.Dra = value;
|
||||
X0Y1_精液.Dra = value;
|
||||
X0Y2_精液.Dra = value;
|
||||
X0Y3_精液.Dra = value;
|
||||
X0Y4_精液.Dra = value;
|
||||
X0Y0_精液.Hit = value;
|
||||
X0Y1_精液.Hit = value;
|
||||
X0Y2_精液.Hit = value;
|
||||
X0Y3_精液.Hit = value;
|
||||
X0Y4_精液.Hit = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool 表示
|
||||
{
|
||||
get
|
||||
{
|
||||
return 精液_表示;
|
||||
}
|
||||
set
|
||||
{
|
||||
精液_表示 = value;
|
||||
}
|
||||
}
|
||||
public override bool 表示
|
||||
{
|
||||
get
|
||||
{
|
||||
return 精液_表示;
|
||||
}
|
||||
set
|
||||
{
|
||||
精液_表示 = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override double 濃度
|
||||
{
|
||||
get
|
||||
{
|
||||
return 精液CD.不透明度;
|
||||
}
|
||||
set
|
||||
{
|
||||
精液CD.不透明度 = value;
|
||||
}
|
||||
}
|
||||
public override double 濃度
|
||||
{
|
||||
get
|
||||
{
|
||||
return 精液CD.不透明度;
|
||||
}
|
||||
set
|
||||
{
|
||||
精液CD.不透明度 = value;
|
||||
}
|
||||
}
|
||||
|
||||
public ぶっかけ_大(double DisUnit, 配色指定 配色指定, 主人公配色 体配色, Med Med, ぶっかけ_大D e)
|
||||
{
|
||||
ThisType = GetType();
|
||||
Dif dif = new Dif(Sta.スタンプ["ぶっかけ"][1]);
|
||||
本体 = new Difs();
|
||||
本体.Tag = dif.Tag;
|
||||
本体.Add(dif);
|
||||
Pars pars = 本体[0][0];
|
||||
X0Y0_精液 = pars["精液"].ToPar();
|
||||
pars = 本体[0][1];
|
||||
X0Y1_精液 = pars["精液"].ToPar();
|
||||
pars = 本体[0][2];
|
||||
X0Y2_精液 = pars["精液"].ToPar();
|
||||
pars = 本体[0][3];
|
||||
X0Y3_精液 = pars["精液"].ToPar();
|
||||
pars = 本体[0][4];
|
||||
X0Y4_精液 = pars["精液"].ToPar();
|
||||
本体.SetJoints();
|
||||
接続根 = new JointD(本体);
|
||||
右 = e.右;
|
||||
反転X = e.反転X;
|
||||
反転Y = e.反転Y;
|
||||
基準C = e.基準C;
|
||||
位置C = e.位置C;
|
||||
角度B = e.角度B;
|
||||
角度C = e.角度C;
|
||||
尺度B = e.尺度B;
|
||||
尺度C = e.尺度C;
|
||||
尺度XB = e.尺度XB;
|
||||
尺度XC = e.尺度XC;
|
||||
尺度YB = e.尺度YB;
|
||||
尺度YC = e.尺度YC;
|
||||
肥大 = e.肥大;
|
||||
身長 = e.身長;
|
||||
Xv = e.Xv;
|
||||
Yv = e.Yv;
|
||||
Xi = e.Xi;
|
||||
Yi = e.Yi;
|
||||
サイズ = e.サイズ;
|
||||
サイズX = e.サイズX;
|
||||
サイズY = e.サイズY;
|
||||
精液_表示 = e.精液_表示;
|
||||
欠損 = e.欠損;
|
||||
筋肉 = e.筋肉;
|
||||
拘束 = e.拘束;
|
||||
if (!e.表示)
|
||||
{
|
||||
表示 = false;
|
||||
}
|
||||
base.配色指定 = 配色指定;
|
||||
配色(体配色);
|
||||
X0Y0_精液CP = new ColorP(X0Y0_精液, 精液CD, DisUnit, abj: true);
|
||||
X0Y1_精液CP = new ColorP(X0Y1_精液, 精液CD, DisUnit, abj: true);
|
||||
X0Y2_精液CP = new ColorP(X0Y2_精液, 精液CD, DisUnit, abj: true);
|
||||
X0Y3_精液CP = new ColorP(X0Y3_精液, 精液CD, DisUnit, abj: true);
|
||||
X0Y4_精液CP = new ColorP(X0Y4_精液, 精液CD, DisUnit, abj: true);
|
||||
濃度 = e.濃度;
|
||||
}
|
||||
public ぶっかけ_大(double DisUnit, 配色指定 配色指定, 主人公配色 体配色, Med Med, ぶっかけ_大D e)
|
||||
{
|
||||
ThisType = GetType();
|
||||
Dif dif = new Dif(Sta.スタンプ["ぶっかけ"][1]);
|
||||
本体 = new Difs();
|
||||
本体.Tag = dif.Tag;
|
||||
本体.Add(dif);
|
||||
Pars pars = 本体[0][0];
|
||||
X0Y0_精液 = pars["精液"].ToPar();
|
||||
pars = 本体[0][1];
|
||||
X0Y1_精液 = pars["精液"].ToPar();
|
||||
pars = 本体[0][2];
|
||||
X0Y2_精液 = pars["精液"].ToPar();
|
||||
pars = 本体[0][3];
|
||||
X0Y3_精液 = pars["精液"].ToPar();
|
||||
pars = 本体[0][4];
|
||||
X0Y4_精液 = pars["精液"].ToPar();
|
||||
本体.SetJoints();
|
||||
接続根 = new JointD(本体);
|
||||
右 = e.右;
|
||||
反転X = e.反転X;
|
||||
反転Y = e.反転Y;
|
||||
基準C = e.基準C;
|
||||
位置C = e.位置C;
|
||||
角度B = e.角度B;
|
||||
角度C = e.角度C;
|
||||
尺度B = e.尺度B;
|
||||
尺度C = e.尺度C;
|
||||
尺度XB = e.尺度XB;
|
||||
尺度XC = e.尺度XC;
|
||||
尺度YB = e.尺度YB;
|
||||
尺度YC = e.尺度YC;
|
||||
肥大 = e.肥大;
|
||||
身長 = e.身長;
|
||||
Xv = e.Xv;
|
||||
Yv = e.Yv;
|
||||
Xi = e.Xi;
|
||||
Yi = e.Yi;
|
||||
サイズ = e.サイズ;
|
||||
サイズX = e.サイズX;
|
||||
サイズY = e.サイズY;
|
||||
精液_表示 = e.精液_表示;
|
||||
欠損 = e.欠損;
|
||||
筋肉 = e.筋肉;
|
||||
拘束 = e.拘束;
|
||||
if (!e.表示)
|
||||
{
|
||||
表示 = false;
|
||||
}
|
||||
base.配色指定 = 配色指定;
|
||||
配色(体配色);
|
||||
X0Y0_精液CP = new ColorP(X0Y0_精液, 精液CD, DisUnit, abj: true);
|
||||
X0Y1_精液CP = new ColorP(X0Y1_精液, 精液CD, DisUnit, abj: true);
|
||||
X0Y2_精液CP = new ColorP(X0Y2_精液, 精液CD, DisUnit, abj: true);
|
||||
X0Y3_精液CP = new ColorP(X0Y3_精液, 精液CD, DisUnit, abj: true);
|
||||
X0Y4_精液CP = new ColorP(X0Y4_精液, 精液CD, DisUnit, abj: true);
|
||||
濃度 = e.濃度;
|
||||
}
|
||||
|
||||
public override void 色更新()
|
||||
{
|
||||
switch (本体.IndexY)
|
||||
{
|
||||
case 0:
|
||||
X0Y0_精液CP.Update();
|
||||
break;
|
||||
case 1:
|
||||
X0Y1_精液CP.Update();
|
||||
break;
|
||||
case 2:
|
||||
X0Y2_精液CP.Update();
|
||||
break;
|
||||
case 3:
|
||||
X0Y3_精液CP.Update();
|
||||
break;
|
||||
default:
|
||||
X0Y4_精液CP.Update();
|
||||
break;
|
||||
}
|
||||
}
|
||||
public override void 色更新()
|
||||
{
|
||||
switch (本体.IndexY)
|
||||
{
|
||||
case 0:
|
||||
X0Y0_精液CP.Update();
|
||||
break;
|
||||
case 1:
|
||||
X0Y1_精液CP.Update();
|
||||
break;
|
||||
case 2:
|
||||
X0Y2_精液CP.Update();
|
||||
break;
|
||||
case 3:
|
||||
X0Y3_精液CP.Update();
|
||||
break;
|
||||
default:
|
||||
X0Y4_精液CP.Update();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void 配色(主人公配色 体配色)
|
||||
{
|
||||
配色N0(体配色);
|
||||
}
|
||||
private void 配色(主人公配色 体配色)
|
||||
{
|
||||
配色N0(体配色);
|
||||
}
|
||||
|
||||
private void 配色N0(主人公配色 体配色)
|
||||
{
|
||||
精液CD = new ColorD(ref 体配色.精線, ref 体配色.精液ぶっかけ);
|
||||
}
|
||||
private void 配色N0(主人公配色 体配色)
|
||||
{
|
||||
精液CD = new ColorD(ref 体配色.精線, ref 体配色.精液ぶっかけ);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,21 @@
|
||||
using System;
|
||||
using _2DGAMELIB;
|
||||
|
||||
namespace SlaveMatrix;
|
||||
|
||||
[Serializable]
|
||||
public class ぶっかけ_大D : EleD
|
||||
namespace SlaveMatrix
|
||||
{
|
||||
public bool 精液_表示 = true;
|
||||
[Serializable]
|
||||
public class ぶっかけ_大D : EleD
|
||||
{
|
||||
public bool 精液_表示 = true;
|
||||
|
||||
public ぶっかけ_大D()
|
||||
{
|
||||
ThisType = GetType();
|
||||
}
|
||||
public ぶっかけ_大D()
|
||||
{
|
||||
ThisType = GetType();
|
||||
}
|
||||
|
||||
public override Ele GetEle(double DisUnit, Med Med, 主人公配色 体配色)
|
||||
{
|
||||
return new ぶっかけ_大(DisUnit, 配色指定, 体配色, Med, this);
|
||||
}
|
||||
public override Ele GetEle(double DisUnit, Med Med, 主人公配色 体配色)
|
||||
{
|
||||
return new ぶっかけ_大(DisUnit, 配色指定, 体配色, Med, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,200 +1,201 @@
|
||||
using _2DGAMELIB;
|
||||
|
||||
namespace SlaveMatrix;
|
||||
|
||||
public class ぶっかけ_小 : Ele
|
||||
namespace SlaveMatrix
|
||||
{
|
||||
public Par X0Y0_精液;
|
||||
public class ぶっかけ_小 : Ele
|
||||
{
|
||||
public Par X0Y0_精液;
|
||||
|
||||
public Par X0Y1_精液;
|
||||
public Par X0Y1_精液;
|
||||
|
||||
public Par X0Y2_精液;
|
||||
public Par X0Y2_精液;
|
||||
|
||||
public Par X0Y3_精液;
|
||||
public Par X0Y3_精液;
|
||||
|
||||
public Par X0Y4_精液;
|
||||
public Par X0Y4_精液;
|
||||
|
||||
public ColorD 精液CD;
|
||||
public ColorD 精液CD;
|
||||
|
||||
public ColorP X0Y0_精液CP;
|
||||
public ColorP X0Y0_精液CP;
|
||||
|
||||
public ColorP X0Y1_精液CP;
|
||||
public ColorP X0Y1_精液CP;
|
||||
|
||||
public ColorP X0Y2_精液CP;
|
||||
public ColorP X0Y2_精液CP;
|
||||
|
||||
public ColorP X0Y3_精液CP;
|
||||
public ColorP X0Y3_精液CP;
|
||||
|
||||
public ColorP X0Y4_精液CP;
|
||||
public ColorP X0Y4_精液CP;
|
||||
|
||||
public override bool 欠損
|
||||
{
|
||||
get
|
||||
{
|
||||
return 欠損_;
|
||||
}
|
||||
set
|
||||
{
|
||||
欠損_ = value;
|
||||
}
|
||||
}
|
||||
public override bool 欠損
|
||||
{
|
||||
get
|
||||
{
|
||||
return 欠損_;
|
||||
}
|
||||
set
|
||||
{
|
||||
欠損_ = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool 筋肉
|
||||
{
|
||||
get
|
||||
{
|
||||
return 筋肉_;
|
||||
}
|
||||
set
|
||||
{
|
||||
筋肉_ = value;
|
||||
}
|
||||
}
|
||||
public override bool 筋肉
|
||||
{
|
||||
get
|
||||
{
|
||||
return 筋肉_;
|
||||
}
|
||||
set
|
||||
{
|
||||
筋肉_ = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool 拘束
|
||||
{
|
||||
get
|
||||
{
|
||||
return 拘束_;
|
||||
}
|
||||
set
|
||||
{
|
||||
拘束_ = value;
|
||||
}
|
||||
}
|
||||
public override bool 拘束
|
||||
{
|
||||
get
|
||||
{
|
||||
return 拘束_;
|
||||
}
|
||||
set
|
||||
{
|
||||
拘束_ = value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool 精液_表示
|
||||
{
|
||||
get
|
||||
{
|
||||
return X0Y0_精液.Dra;
|
||||
}
|
||||
set
|
||||
{
|
||||
X0Y0_精液.Dra = value;
|
||||
X0Y1_精液.Dra = value;
|
||||
X0Y2_精液.Dra = value;
|
||||
X0Y3_精液.Dra = value;
|
||||
X0Y4_精液.Dra = value;
|
||||
X0Y0_精液.Hit = value;
|
||||
X0Y1_精液.Hit = value;
|
||||
X0Y2_精液.Hit = value;
|
||||
X0Y3_精液.Hit = value;
|
||||
X0Y4_精液.Hit = value;
|
||||
}
|
||||
}
|
||||
public bool 精液_表示
|
||||
{
|
||||
get
|
||||
{
|
||||
return X0Y0_精液.Dra;
|
||||
}
|
||||
set
|
||||
{
|
||||
X0Y0_精液.Dra = value;
|
||||
X0Y1_精液.Dra = value;
|
||||
X0Y2_精液.Dra = value;
|
||||
X0Y3_精液.Dra = value;
|
||||
X0Y4_精液.Dra = value;
|
||||
X0Y0_精液.Hit = value;
|
||||
X0Y1_精液.Hit = value;
|
||||
X0Y2_精液.Hit = value;
|
||||
X0Y3_精液.Hit = value;
|
||||
X0Y4_精液.Hit = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool 表示
|
||||
{
|
||||
get
|
||||
{
|
||||
return 精液_表示;
|
||||
}
|
||||
set
|
||||
{
|
||||
精液_表示 = value;
|
||||
}
|
||||
}
|
||||
public override bool 表示
|
||||
{
|
||||
get
|
||||
{
|
||||
return 精液_表示;
|
||||
}
|
||||
set
|
||||
{
|
||||
精液_表示 = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override double 濃度
|
||||
{
|
||||
get
|
||||
{
|
||||
return 精液CD.不透明度;
|
||||
}
|
||||
set
|
||||
{
|
||||
精液CD.不透明度 = value;
|
||||
}
|
||||
}
|
||||
public override double 濃度
|
||||
{
|
||||
get
|
||||
{
|
||||
return 精液CD.不透明度;
|
||||
}
|
||||
set
|
||||
{
|
||||
精液CD.不透明度 = value;
|
||||
}
|
||||
}
|
||||
|
||||
public ぶっかけ_小(double DisUnit, 配色指定 配色指定, 主人公配色 体配色, Med Med, ぶっかけ_小D e)
|
||||
{
|
||||
ThisType = GetType();
|
||||
Dif dif = new Dif(Sta.スタンプ["ぶっかけ"][0]);
|
||||
本体 = new Difs();
|
||||
本体.Tag = dif.Tag;
|
||||
本体.Add(dif);
|
||||
Pars pars = 本体[0][0];
|
||||
X0Y0_精液 = pars["精液"].ToPar();
|
||||
pars = 本体[0][1];
|
||||
X0Y1_精液 = pars["精液"].ToPar();
|
||||
pars = 本体[0][2];
|
||||
X0Y2_精液 = pars["精液"].ToPar();
|
||||
pars = 本体[0][3];
|
||||
X0Y3_精液 = pars["精液"].ToPar();
|
||||
pars = 本体[0][4];
|
||||
X0Y4_精液 = pars["精液"].ToPar();
|
||||
本体.SetJoints();
|
||||
接続根 = new JointD(本体);
|
||||
右 = e.右;
|
||||
反転X = e.反転X;
|
||||
反転Y = e.反転Y;
|
||||
基準C = e.基準C;
|
||||
位置C = e.位置C;
|
||||
角度B = e.角度B;
|
||||
角度C = e.角度C;
|
||||
尺度B = e.尺度B;
|
||||
尺度C = e.尺度C;
|
||||
尺度XB = e.尺度XB;
|
||||
尺度XC = e.尺度XC;
|
||||
尺度YB = e.尺度YB;
|
||||
尺度YC = e.尺度YC;
|
||||
肥大 = e.肥大;
|
||||
身長 = e.身長;
|
||||
Xv = e.Xv;
|
||||
Yv = e.Yv;
|
||||
Xi = e.Xi;
|
||||
Yi = e.Yi;
|
||||
サイズ = e.サイズ;
|
||||
サイズX = e.サイズX;
|
||||
サイズY = e.サイズY;
|
||||
精液_表示 = e.精液_表示;
|
||||
欠損 = e.欠損;
|
||||
筋肉 = e.筋肉;
|
||||
拘束 = e.拘束;
|
||||
if (!e.表示)
|
||||
{
|
||||
表示 = false;
|
||||
}
|
||||
base.配色指定 = 配色指定;
|
||||
配色(体配色);
|
||||
X0Y0_精液CP = new ColorP(X0Y0_精液, 精液CD, DisUnit, abj: true);
|
||||
X0Y1_精液CP = new ColorP(X0Y1_精液, 精液CD, DisUnit, abj: true);
|
||||
X0Y2_精液CP = new ColorP(X0Y2_精液, 精液CD, DisUnit, abj: true);
|
||||
X0Y3_精液CP = new ColorP(X0Y3_精液, 精液CD, DisUnit, abj: true);
|
||||
X0Y4_精液CP = new ColorP(X0Y4_精液, 精液CD, DisUnit, abj: true);
|
||||
濃度 = e.濃度;
|
||||
}
|
||||
public ぶっかけ_小(double DisUnit, 配色指定 配色指定, 主人公配色 体配色, Med Med, ぶっかけ_小D e)
|
||||
{
|
||||
ThisType = GetType();
|
||||
Dif dif = new Dif(Sta.スタンプ["ぶっかけ"][0]);
|
||||
本体 = new Difs();
|
||||
本体.Tag = dif.Tag;
|
||||
本体.Add(dif);
|
||||
Pars pars = 本体[0][0];
|
||||
X0Y0_精液 = pars["精液"].ToPar();
|
||||
pars = 本体[0][1];
|
||||
X0Y1_精液 = pars["精液"].ToPar();
|
||||
pars = 本体[0][2];
|
||||
X0Y2_精液 = pars["精液"].ToPar();
|
||||
pars = 本体[0][3];
|
||||
X0Y3_精液 = pars["精液"].ToPar();
|
||||
pars = 本体[0][4];
|
||||
X0Y4_精液 = pars["精液"].ToPar();
|
||||
本体.SetJoints();
|
||||
接続根 = new JointD(本体);
|
||||
右 = e.右;
|
||||
反転X = e.反転X;
|
||||
反転Y = e.反転Y;
|
||||
基準C = e.基準C;
|
||||
位置C = e.位置C;
|
||||
角度B = e.角度B;
|
||||
角度C = e.角度C;
|
||||
尺度B = e.尺度B;
|
||||
尺度C = e.尺度C;
|
||||
尺度XB = e.尺度XB;
|
||||
尺度XC = e.尺度XC;
|
||||
尺度YB = e.尺度YB;
|
||||
尺度YC = e.尺度YC;
|
||||
肥大 = e.肥大;
|
||||
身長 = e.身長;
|
||||
Xv = e.Xv;
|
||||
Yv = e.Yv;
|
||||
Xi = e.Xi;
|
||||
Yi = e.Yi;
|
||||
サイズ = e.サイズ;
|
||||
サイズX = e.サイズX;
|
||||
サイズY = e.サイズY;
|
||||
精液_表示 = e.精液_表示;
|
||||
欠損 = e.欠損;
|
||||
筋肉 = e.筋肉;
|
||||
拘束 = e.拘束;
|
||||
if (!e.表示)
|
||||
{
|
||||
表示 = false;
|
||||
}
|
||||
base.配色指定 = 配色指定;
|
||||
配色(体配色);
|
||||
X0Y0_精液CP = new ColorP(X0Y0_精液, 精液CD, DisUnit, abj: true);
|
||||
X0Y1_精液CP = new ColorP(X0Y1_精液, 精液CD, DisUnit, abj: true);
|
||||
X0Y2_精液CP = new ColorP(X0Y2_精液, 精液CD, DisUnit, abj: true);
|
||||
X0Y3_精液CP = new ColorP(X0Y3_精液, 精液CD, DisUnit, abj: true);
|
||||
X0Y4_精液CP = new ColorP(X0Y4_精液, 精液CD, DisUnit, abj: true);
|
||||
濃度 = e.濃度;
|
||||
}
|
||||
|
||||
public override void 色更新()
|
||||
{
|
||||
switch (本体.IndexY)
|
||||
{
|
||||
case 0:
|
||||
X0Y0_精液CP.Update();
|
||||
break;
|
||||
case 1:
|
||||
X0Y1_精液CP.Update();
|
||||
break;
|
||||
case 2:
|
||||
X0Y2_精液CP.Update();
|
||||
break;
|
||||
case 3:
|
||||
X0Y3_精液CP.Update();
|
||||
break;
|
||||
default:
|
||||
X0Y4_精液CP.Update();
|
||||
break;
|
||||
}
|
||||
}
|
||||
public override void 色更新()
|
||||
{
|
||||
switch (本体.IndexY)
|
||||
{
|
||||
case 0:
|
||||
X0Y0_精液CP.Update();
|
||||
break;
|
||||
case 1:
|
||||
X0Y1_精液CP.Update();
|
||||
break;
|
||||
case 2:
|
||||
X0Y2_精液CP.Update();
|
||||
break;
|
||||
case 3:
|
||||
X0Y3_精液CP.Update();
|
||||
break;
|
||||
default:
|
||||
X0Y4_精液CP.Update();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void 配色(主人公配色 体配色)
|
||||
{
|
||||
配色N0(体配色);
|
||||
}
|
||||
private void 配色(主人公配色 体配色)
|
||||
{
|
||||
配色N0(体配色);
|
||||
}
|
||||
|
||||
private void 配色N0(主人公配色 体配色)
|
||||
{
|
||||
精液CD = new ColorD(ref 体配色.精線, ref 体配色.精液ぶっかけ);
|
||||
}
|
||||
private void 配色N0(主人公配色 体配色)
|
||||
{
|
||||
精液CD = new ColorD(ref 体配色.精線, ref 体配色.精液ぶっかけ);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,21 @@
|
||||
using System;
|
||||
using _2DGAMELIB;
|
||||
|
||||
namespace SlaveMatrix;
|
||||
|
||||
[Serializable]
|
||||
public class ぶっかけ_小D : EleD
|
||||
namespace SlaveMatrix
|
||||
{
|
||||
public bool 精液_表示 = true;
|
||||
[Serializable]
|
||||
public class ぶっかけ_小D : EleD
|
||||
{
|
||||
public bool 精液_表示 = true;
|
||||
|
||||
public ぶっかけ_小D()
|
||||
{
|
||||
ThisType = GetType();
|
||||
}
|
||||
public ぶっかけ_小D()
|
||||
{
|
||||
ThisType = GetType();
|
||||
}
|
||||
|
||||
public override Ele GetEle(double DisUnit, Med Med, 主人公配色 体配色)
|
||||
{
|
||||
return new ぶっかけ_小(DisUnit, 配色指定, 体配色, Med, this);
|
||||
}
|
||||
public override Ele GetEle(double DisUnit, Med Med, 主人公配色 体配色)
|
||||
{
|
||||
return new ぶっかけ_小(DisUnit, 配色指定, 体配色, Med, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
namespace SlaveMatrix;
|
||||
|
||||
public class アップ : 後髪1
|
||||
namespace SlaveMatrix
|
||||
{
|
||||
public class アップ : 後髪1
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
using System;
|
||||
|
||||
namespace SlaveMatrix;
|
||||
|
||||
[Serializable]
|
||||
public class アップD : 後髪1D
|
||||
namespace SlaveMatrix
|
||||
{
|
||||
[Serializable]
|
||||
public class アップD : 後髪1D
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,144 +1,145 @@
|
||||
using _2DGAMELIB;
|
||||
|
||||
namespace SlaveMatrix;
|
||||
|
||||
public class キスマーク : Ele
|
||||
namespace SlaveMatrix
|
||||
{
|
||||
public Par X0Y0_キスマーク;
|
||||
public class キスマーク : Ele
|
||||
{
|
||||
public Par X0Y0_キスマーク;
|
||||
|
||||
public ColorD キスマークCD;
|
||||
public ColorD キスマークCD;
|
||||
|
||||
public ColorP X0Y0_キスマークCP;
|
||||
public ColorP X0Y0_キスマークCP;
|
||||
|
||||
public override bool 欠損
|
||||
{
|
||||
get
|
||||
{
|
||||
return 欠損_;
|
||||
}
|
||||
set
|
||||
{
|
||||
欠損_ = value;
|
||||
}
|
||||
}
|
||||
public override bool 欠損
|
||||
{
|
||||
get
|
||||
{
|
||||
return 欠損_;
|
||||
}
|
||||
set
|
||||
{
|
||||
欠損_ = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool 筋肉
|
||||
{
|
||||
get
|
||||
{
|
||||
return 筋肉_;
|
||||
}
|
||||
set
|
||||
{
|
||||
筋肉_ = value;
|
||||
}
|
||||
}
|
||||
public override bool 筋肉
|
||||
{
|
||||
get
|
||||
{
|
||||
return 筋肉_;
|
||||
}
|
||||
set
|
||||
{
|
||||
筋肉_ = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool 拘束
|
||||
{
|
||||
get
|
||||
{
|
||||
return 拘束_;
|
||||
}
|
||||
set
|
||||
{
|
||||
拘束_ = value;
|
||||
}
|
||||
}
|
||||
public override bool 拘束
|
||||
{
|
||||
get
|
||||
{
|
||||
return 拘束_;
|
||||
}
|
||||
set
|
||||
{
|
||||
拘束_ = value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool キスマーク_表示
|
||||
{
|
||||
get
|
||||
{
|
||||
return X0Y0_キスマーク.Dra;
|
||||
}
|
||||
set
|
||||
{
|
||||
X0Y0_キスマーク.Dra = value;
|
||||
X0Y0_キスマーク.Hit = value;
|
||||
}
|
||||
}
|
||||
public bool キスマーク_表示
|
||||
{
|
||||
get
|
||||
{
|
||||
return X0Y0_キスマーク.Dra;
|
||||
}
|
||||
set
|
||||
{
|
||||
X0Y0_キスマーク.Dra = value;
|
||||
X0Y0_キスマーク.Hit = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool 表示
|
||||
{
|
||||
get
|
||||
{
|
||||
return キスマーク_表示;
|
||||
}
|
||||
set
|
||||
{
|
||||
キスマーク_表示 = value;
|
||||
}
|
||||
}
|
||||
public override bool 表示
|
||||
{
|
||||
get
|
||||
{
|
||||
return キスマーク_表示;
|
||||
}
|
||||
set
|
||||
{
|
||||
キスマーク_表示 = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override double 濃度
|
||||
{
|
||||
get
|
||||
{
|
||||
return キスマークCD.不透明度;
|
||||
}
|
||||
set
|
||||
{
|
||||
キスマークCD.不透明度 = value;
|
||||
}
|
||||
}
|
||||
public override double 濃度
|
||||
{
|
||||
get
|
||||
{
|
||||
return キスマークCD.不透明度;
|
||||
}
|
||||
set
|
||||
{
|
||||
キスマークCD.不透明度 = value;
|
||||
}
|
||||
}
|
||||
|
||||
public キスマーク(double DisUnit, 配色指定 配色指定, 体配色 体配色, Med Med, キスマークD e)
|
||||
{
|
||||
ThisType = GetType();
|
||||
本体 = new Difs(Sta.スタンプ["キスマーク"]);
|
||||
Pars pars = 本体[0][0];
|
||||
X0Y0_キスマーク = pars["キスマーク"].ToPar();
|
||||
本体.SetJoints();
|
||||
接続根 = new JointD(本体);
|
||||
右 = e.右;
|
||||
反転X = e.反転X;
|
||||
反転Y = e.反転Y;
|
||||
基準C = e.基準C;
|
||||
位置C = e.位置C;
|
||||
角度B = e.角度B;
|
||||
角度C = e.角度C;
|
||||
尺度B = e.尺度B;
|
||||
尺度C = e.尺度C;
|
||||
尺度XB = e.尺度XB;
|
||||
尺度XC = e.尺度XC;
|
||||
尺度YB = e.尺度YB;
|
||||
尺度YC = e.尺度YC;
|
||||
肥大 = e.肥大;
|
||||
身長 = e.身長;
|
||||
Xv = e.Xv;
|
||||
Yv = e.Yv;
|
||||
Xi = e.Xi;
|
||||
Yi = e.Yi;
|
||||
サイズ = e.サイズ;
|
||||
サイズX = e.サイズX;
|
||||
サイズY = e.サイズY;
|
||||
キスマーク_表示 = e.キスマーク_表示;
|
||||
欠損 = e.欠損;
|
||||
筋肉 = e.筋肉;
|
||||
拘束 = e.拘束;
|
||||
if (!e.表示)
|
||||
{
|
||||
表示 = false;
|
||||
}
|
||||
base.配色指定 = 配色指定;
|
||||
配色(体配色);
|
||||
X0Y0_キスマークCP = new ColorP(X0Y0_キスマーク, キスマークCD, DisUnit, abj: true);
|
||||
濃度 = e.濃度;
|
||||
}
|
||||
public キスマーク(double DisUnit, 配色指定 配色指定, 体配色 体配色, Med Med, キスマークD e)
|
||||
{
|
||||
ThisType = GetType();
|
||||
本体 = new Difs(Sta.スタンプ["キスマーク"]);
|
||||
Pars pars = 本体[0][0];
|
||||
X0Y0_キスマーク = pars["キスマーク"].ToPar();
|
||||
本体.SetJoints();
|
||||
接続根 = new JointD(本体);
|
||||
右 = e.右;
|
||||
反転X = e.反転X;
|
||||
反転Y = e.反転Y;
|
||||
基準C = e.基準C;
|
||||
位置C = e.位置C;
|
||||
角度B = e.角度B;
|
||||
角度C = e.角度C;
|
||||
尺度B = e.尺度B;
|
||||
尺度C = e.尺度C;
|
||||
尺度XB = e.尺度XB;
|
||||
尺度XC = e.尺度XC;
|
||||
尺度YB = e.尺度YB;
|
||||
尺度YC = e.尺度YC;
|
||||
肥大 = e.肥大;
|
||||
身長 = e.身長;
|
||||
Xv = e.Xv;
|
||||
Yv = e.Yv;
|
||||
Xi = e.Xi;
|
||||
Yi = e.Yi;
|
||||
サイズ = e.サイズ;
|
||||
サイズX = e.サイズX;
|
||||
サイズY = e.サイズY;
|
||||
キスマーク_表示 = e.キスマーク_表示;
|
||||
欠損 = e.欠損;
|
||||
筋肉 = e.筋肉;
|
||||
拘束 = e.拘束;
|
||||
if (!e.表示)
|
||||
{
|
||||
表示 = false;
|
||||
}
|
||||
base.配色指定 = 配色指定;
|
||||
配色(体配色);
|
||||
X0Y0_キスマークCP = new ColorP(X0Y0_キスマーク, キスマークCD, DisUnit, abj: true);
|
||||
濃度 = e.濃度;
|
||||
}
|
||||
|
||||
public override void 色更新()
|
||||
{
|
||||
X0Y0_キスマークCP.Update();
|
||||
}
|
||||
public override void 色更新()
|
||||
{
|
||||
X0Y0_キスマークCP.Update();
|
||||
}
|
||||
|
||||
private void 配色(体配色 体配色)
|
||||
{
|
||||
配色N0(体配色);
|
||||
}
|
||||
private void 配色(体配色 体配色)
|
||||
{
|
||||
配色N0(体配色);
|
||||
}
|
||||
|
||||
private void 配色N0(体配色 体配色)
|
||||
{
|
||||
キスマークCD = new ColorD(ref Col.Empty, ref 体配色.粘膜);
|
||||
}
|
||||
private void 配色N0(体配色 体配色)
|
||||
{
|
||||
キスマークCD = new ColorD(ref Col.Empty, ref 体配色.粘膜);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,21 @@
|
||||
using System;
|
||||
using _2DGAMELIB;
|
||||
|
||||
namespace SlaveMatrix;
|
||||
|
||||
[Serializable]
|
||||
public class キスマークD : EleD
|
||||
namespace SlaveMatrix
|
||||
{
|
||||
public bool キスマーク_表示 = true;
|
||||
[Serializable]
|
||||
public class キスマークD : EleD
|
||||
{
|
||||
public bool キスマーク_表示 = true;
|
||||
|
||||
public キスマークD()
|
||||
{
|
||||
ThisType = GetType();
|
||||
}
|
||||
public キスマークD()
|
||||
{
|
||||
ThisType = GetType();
|
||||
}
|
||||
|
||||
public override Ele GetEle(double DisUnit, Med Med, 体配色 体配色)
|
||||
{
|
||||
return new キスマーク(DisUnit, 配色指定, 体配色, Med, this);
|
||||
}
|
||||
public override Ele GetEle(double DisUnit, Med Med, 体配色 体配色)
|
||||
{
|
||||
return new キスマーク(DisUnit, 配色指定, 体配色, Med, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,195 +1,196 @@
|
||||
using _2DGAMELIB;
|
||||
|
||||
namespace SlaveMatrix;
|
||||
|
||||
public class キャップ1 : Ele
|
||||
namespace SlaveMatrix
|
||||
{
|
||||
public Par X0Y0_根本;
|
||||
public class キャップ1 : Ele
|
||||
{
|
||||
public Par X0Y0_根本;
|
||||
|
||||
public Par X0Y0_先端;
|
||||
public Par X0Y0_先端;
|
||||
|
||||
public ColorD 根本CD;
|
||||
public ColorD 根本CD;
|
||||
|
||||
public ColorD 先端CD;
|
||||
public ColorD 先端CD;
|
||||
|
||||
public ColorP X0Y0_根本CP;
|
||||
public ColorP X0Y0_根本CP;
|
||||
|
||||
public ColorP X0Y0_先端CP;
|
||||
public ColorP X0Y0_先端CP;
|
||||
|
||||
public override bool 欠損
|
||||
{
|
||||
get
|
||||
{
|
||||
return 欠損_;
|
||||
}
|
||||
set
|
||||
{
|
||||
欠損_ = value;
|
||||
}
|
||||
}
|
||||
public override bool 欠損
|
||||
{
|
||||
get
|
||||
{
|
||||
return 欠損_;
|
||||
}
|
||||
set
|
||||
{
|
||||
欠損_ = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool 筋肉
|
||||
{
|
||||
get
|
||||
{
|
||||
return 筋肉_;
|
||||
}
|
||||
set
|
||||
{
|
||||
筋肉_ = value;
|
||||
}
|
||||
}
|
||||
public override bool 筋肉
|
||||
{
|
||||
get
|
||||
{
|
||||
return 筋肉_;
|
||||
}
|
||||
set
|
||||
{
|
||||
筋肉_ = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool 拘束
|
||||
{
|
||||
get
|
||||
{
|
||||
return 拘束_;
|
||||
}
|
||||
set
|
||||
{
|
||||
拘束_ = value;
|
||||
}
|
||||
}
|
||||
public override bool 拘束
|
||||
{
|
||||
get
|
||||
{
|
||||
return 拘束_;
|
||||
}
|
||||
set
|
||||
{
|
||||
拘束_ = value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool 根本_表示
|
||||
{
|
||||
get
|
||||
{
|
||||
return X0Y0_根本.Dra;
|
||||
}
|
||||
set
|
||||
{
|
||||
X0Y0_根本.Dra = value;
|
||||
X0Y0_根本.Hit = value;
|
||||
}
|
||||
}
|
||||
public bool 根本_表示
|
||||
{
|
||||
get
|
||||
{
|
||||
return X0Y0_根本.Dra;
|
||||
}
|
||||
set
|
||||
{
|
||||
X0Y0_根本.Dra = value;
|
||||
X0Y0_根本.Hit = value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool 先端_表示
|
||||
{
|
||||
get
|
||||
{
|
||||
return X0Y0_先端.Dra;
|
||||
}
|
||||
set
|
||||
{
|
||||
X0Y0_先端.Dra = value;
|
||||
X0Y0_先端.Hit = value;
|
||||
}
|
||||
}
|
||||
public bool 先端_表示
|
||||
{
|
||||
get
|
||||
{
|
||||
return X0Y0_先端.Dra;
|
||||
}
|
||||
set
|
||||
{
|
||||
X0Y0_先端.Dra = value;
|
||||
X0Y0_先端.Hit = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool 表示
|
||||
{
|
||||
get
|
||||
{
|
||||
return 根本_表示;
|
||||
}
|
||||
set
|
||||
{
|
||||
根本_表示 = value;
|
||||
先端_表示 = value;
|
||||
}
|
||||
}
|
||||
public override bool 表示
|
||||
{
|
||||
get
|
||||
{
|
||||
return 根本_表示;
|
||||
}
|
||||
set
|
||||
{
|
||||
根本_表示 = value;
|
||||
先端_表示 = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override double 濃度
|
||||
{
|
||||
get
|
||||
{
|
||||
return 根本CD.不透明度;
|
||||
}
|
||||
set
|
||||
{
|
||||
根本CD.不透明度 = value;
|
||||
先端CD.不透明度 = value;
|
||||
}
|
||||
}
|
||||
public override double 濃度
|
||||
{
|
||||
get
|
||||
{
|
||||
return 根本CD.不透明度;
|
||||
}
|
||||
set
|
||||
{
|
||||
根本CD.不透明度 = value;
|
||||
先端CD.不透明度 = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override double 肥大
|
||||
{
|
||||
set
|
||||
{
|
||||
}
|
||||
}
|
||||
public override double 肥大
|
||||
{
|
||||
set
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public override double 身長
|
||||
{
|
||||
set
|
||||
{
|
||||
}
|
||||
}
|
||||
public override double 身長
|
||||
{
|
||||
set
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public キャップ1(double DisUnit, 配色指定 配色指定, 体配色 体配色, Med Med, キャップ1D e)
|
||||
{
|
||||
ThisType = GetType();
|
||||
本体 = new Difs(Sta.性器付["キャップ中"]);
|
||||
Pars pars = 本体[0][0];
|
||||
X0Y0_根本 = pars["根本"].ToPar();
|
||||
X0Y0_先端 = pars["先端"].ToPar();
|
||||
本体.SetJoints();
|
||||
接続根 = new JointD(本体);
|
||||
右 = e.右;
|
||||
反転X = e.反転X;
|
||||
反転Y = e.反転Y;
|
||||
基準C = e.基準C;
|
||||
位置C = e.位置C;
|
||||
角度B = e.角度B;
|
||||
角度C = e.角度C;
|
||||
尺度B = e.尺度B;
|
||||
尺度C = e.尺度C;
|
||||
尺度XB = e.尺度XB;
|
||||
尺度XC = e.尺度XC;
|
||||
尺度YB = e.尺度YB;
|
||||
尺度YC = e.尺度YC;
|
||||
肥大 = e.肥大;
|
||||
身長 = e.身長;
|
||||
Xv = e.Xv;
|
||||
Yv = e.Yv;
|
||||
Xi = e.Xi;
|
||||
Yi = e.Yi;
|
||||
サイズ = e.サイズ;
|
||||
サイズX = e.サイズX;
|
||||
サイズY = e.サイズY;
|
||||
根本_表示 = e.根本_表示;
|
||||
先端_表示 = e.先端_表示;
|
||||
欠損 = e.欠損;
|
||||
筋肉 = e.筋肉;
|
||||
拘束 = e.拘束;
|
||||
if (!e.表示)
|
||||
{
|
||||
表示 = false;
|
||||
}
|
||||
base.配色指定 = 配色指定;
|
||||
配色(体配色);
|
||||
X0Y0_根本CP = new ColorP(X0Y0_根本, 根本CD, DisUnit, abj: true);
|
||||
X0Y0_先端CP = new ColorP(X0Y0_先端, 先端CD, DisUnit, abj: true);
|
||||
濃度 = e.濃度;
|
||||
Vector2D local = X0Y0_根本.OP[0].ps[2];
|
||||
foreach (Par item in 本体.EnumJoinRoot)
|
||||
{
|
||||
item.BasePointBase = item.ToLocal(X0Y0_根本.ToGlobal(local));
|
||||
}
|
||||
}
|
||||
public キャップ1(double DisUnit, 配色指定 配色指定, 体配色 体配色, Med Med, キャップ1D e)
|
||||
{
|
||||
ThisType = GetType();
|
||||
本体 = new Difs(Sta.性器付["キャップ中"]);
|
||||
Pars pars = 本体[0][0];
|
||||
X0Y0_根本 = pars["根本"].ToPar();
|
||||
X0Y0_先端 = pars["先端"].ToPar();
|
||||
本体.SetJoints();
|
||||
接続根 = new JointD(本体);
|
||||
右 = e.右;
|
||||
反転X = e.反転X;
|
||||
反転Y = e.反転Y;
|
||||
基準C = e.基準C;
|
||||
位置C = e.位置C;
|
||||
角度B = e.角度B;
|
||||
角度C = e.角度C;
|
||||
尺度B = e.尺度B;
|
||||
尺度C = e.尺度C;
|
||||
尺度XB = e.尺度XB;
|
||||
尺度XC = e.尺度XC;
|
||||
尺度YB = e.尺度YB;
|
||||
尺度YC = e.尺度YC;
|
||||
肥大 = e.肥大;
|
||||
身長 = e.身長;
|
||||
Xv = e.Xv;
|
||||
Yv = e.Yv;
|
||||
Xi = e.Xi;
|
||||
Yi = e.Yi;
|
||||
サイズ = e.サイズ;
|
||||
サイズX = e.サイズX;
|
||||
サイズY = e.サイズY;
|
||||
根本_表示 = e.根本_表示;
|
||||
先端_表示 = e.先端_表示;
|
||||
欠損 = e.欠損;
|
||||
筋肉 = e.筋肉;
|
||||
拘束 = e.拘束;
|
||||
if (!e.表示)
|
||||
{
|
||||
表示 = false;
|
||||
}
|
||||
base.配色指定 = 配色指定;
|
||||
配色(体配色);
|
||||
X0Y0_根本CP = new ColorP(X0Y0_根本, 根本CD, DisUnit, abj: true);
|
||||
X0Y0_先端CP = new ColorP(X0Y0_先端, 先端CD, DisUnit, abj: true);
|
||||
濃度 = e.濃度;
|
||||
Vector2D local = X0Y0_根本.OP[0].ps[2];
|
||||
foreach (Par item in 本体.EnumJoinRoot)
|
||||
{
|
||||
item.BasePointBase = item.ToLocal(X0Y0_根本.ToGlobal(local));
|
||||
}
|
||||
}
|
||||
|
||||
public override void 色更新()
|
||||
{
|
||||
X0Y0_根本CP.Update();
|
||||
X0Y0_先端CP.Update();
|
||||
}
|
||||
public override void 色更新()
|
||||
{
|
||||
X0Y0_根本CP.Update();
|
||||
X0Y0_先端CP.Update();
|
||||
}
|
||||
|
||||
private void 配色(体配色 体配色)
|
||||
{
|
||||
配色N0(体配色);
|
||||
}
|
||||
private void 配色(体配色 体配色)
|
||||
{
|
||||
配色N0(体配色);
|
||||
}
|
||||
|
||||
private void 配色N0(体配色 体配色)
|
||||
{
|
||||
根本CD = new ColorD();
|
||||
先端CD = new ColorD();
|
||||
}
|
||||
private void 配色N0(体配色 体配色)
|
||||
{
|
||||
根本CD = new ColorD();
|
||||
先端CD = new ColorD();
|
||||
}
|
||||
|
||||
public void 配色(キャップ色 配色)
|
||||
{
|
||||
根本CD.色 = 配色.根本色;
|
||||
先端CD.色 = 配色.先端色;
|
||||
}
|
||||
public void 配色(キャップ色 配色)
|
||||
{
|
||||
根本CD.色 = 配色.根本色;
|
||||
先端CD.色 = 配色.先端色;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,22 +1,23 @@
|
||||
using System;
|
||||
using _2DGAMELIB;
|
||||
|
||||
namespace SlaveMatrix;
|
||||
|
||||
[Serializable]
|
||||
public class キャップ1D : EleD
|
||||
namespace SlaveMatrix
|
||||
{
|
||||
public bool 根本_表示;
|
||||
[Serializable]
|
||||
public class キャップ1D : EleD
|
||||
{
|
||||
public bool 根本_表示;
|
||||
|
||||
public bool 先端_表示;
|
||||
public bool 先端_表示;
|
||||
|
||||
public キャップ1D()
|
||||
{
|
||||
ThisType = GetType();
|
||||
}
|
||||
public キャップ1D()
|
||||
{
|
||||
ThisType = GetType();
|
||||
}
|
||||
|
||||
public override Ele GetEle(double DisUnit, Med Med, 体配色 体配色)
|
||||
{
|
||||
return new キャップ1(DisUnit, 配色指定, 体配色, Med, this);
|
||||
}
|
||||
public override Ele GetEle(double DisUnit, Med Med, 体配色 体配色)
|
||||
{
|
||||
return new キャップ1(DisUnit, 配色指定, 体配色, Med, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,190 +1,191 @@
|
||||
using _2DGAMELIB;
|
||||
|
||||
namespace SlaveMatrix;
|
||||
|
||||
public class キャップ2 : Ele
|
||||
namespace SlaveMatrix
|
||||
{
|
||||
public Par X0Y0_根本;
|
||||
public class キャップ2 : Ele
|
||||
{
|
||||
public Par X0Y0_根本;
|
||||
|
||||
public Par X0Y0_先端;
|
||||
public Par X0Y0_先端;
|
||||
|
||||
public ColorD 根本CD;
|
||||
public ColorD 根本CD;
|
||||
|
||||
public ColorD 先端CD;
|
||||
public ColorD 先端CD;
|
||||
|
||||
public ColorP X0Y0_根本CP;
|
||||
public ColorP X0Y0_根本CP;
|
||||
|
||||
public ColorP X0Y0_先端CP;
|
||||
public ColorP X0Y0_先端CP;
|
||||
|
||||
public override bool 欠損
|
||||
{
|
||||
get
|
||||
{
|
||||
return 欠損_;
|
||||
}
|
||||
set
|
||||
{
|
||||
欠損_ = value;
|
||||
}
|
||||
}
|
||||
public override bool 欠損
|
||||
{
|
||||
get
|
||||
{
|
||||
return 欠損_;
|
||||
}
|
||||
set
|
||||
{
|
||||
欠損_ = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool 筋肉
|
||||
{
|
||||
get
|
||||
{
|
||||
return 筋肉_;
|
||||
}
|
||||
set
|
||||
{
|
||||
筋肉_ = value;
|
||||
}
|
||||
}
|
||||
public override bool 筋肉
|
||||
{
|
||||
get
|
||||
{
|
||||
return 筋肉_;
|
||||
}
|
||||
set
|
||||
{
|
||||
筋肉_ = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool 拘束
|
||||
{
|
||||
get
|
||||
{
|
||||
return 拘束_;
|
||||
}
|
||||
set
|
||||
{
|
||||
拘束_ = value;
|
||||
}
|
||||
}
|
||||
public override bool 拘束
|
||||
{
|
||||
get
|
||||
{
|
||||
return 拘束_;
|
||||
}
|
||||
set
|
||||
{
|
||||
拘束_ = value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool 根本_表示
|
||||
{
|
||||
get
|
||||
{
|
||||
return X0Y0_根本.Dra;
|
||||
}
|
||||
set
|
||||
{
|
||||
X0Y0_根本.Dra = value;
|
||||
X0Y0_根本.Hit = value;
|
||||
}
|
||||
}
|
||||
public bool 根本_表示
|
||||
{
|
||||
get
|
||||
{
|
||||
return X0Y0_根本.Dra;
|
||||
}
|
||||
set
|
||||
{
|
||||
X0Y0_根本.Dra = value;
|
||||
X0Y0_根本.Hit = value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool 先端_表示
|
||||
{
|
||||
get
|
||||
{
|
||||
return X0Y0_先端.Dra;
|
||||
}
|
||||
set
|
||||
{
|
||||
X0Y0_先端.Dra = value;
|
||||
X0Y0_先端.Hit = value;
|
||||
}
|
||||
}
|
||||
public bool 先端_表示
|
||||
{
|
||||
get
|
||||
{
|
||||
return X0Y0_先端.Dra;
|
||||
}
|
||||
set
|
||||
{
|
||||
X0Y0_先端.Dra = value;
|
||||
X0Y0_先端.Hit = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool 表示
|
||||
{
|
||||
get
|
||||
{
|
||||
return 根本_表示;
|
||||
}
|
||||
set
|
||||
{
|
||||
根本_表示 = value;
|
||||
先端_表示 = value;
|
||||
}
|
||||
}
|
||||
public override bool 表示
|
||||
{
|
||||
get
|
||||
{
|
||||
return 根本_表示;
|
||||
}
|
||||
set
|
||||
{
|
||||
根本_表示 = value;
|
||||
先端_表示 = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override double 濃度
|
||||
{
|
||||
get
|
||||
{
|
||||
return 根本CD.不透明度;
|
||||
}
|
||||
set
|
||||
{
|
||||
根本CD.不透明度 = value;
|
||||
先端CD.不透明度 = value;
|
||||
}
|
||||
}
|
||||
public override double 濃度
|
||||
{
|
||||
get
|
||||
{
|
||||
return 根本CD.不透明度;
|
||||
}
|
||||
set
|
||||
{
|
||||
根本CD.不透明度 = value;
|
||||
先端CD.不透明度 = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override double 肥大
|
||||
{
|
||||
set
|
||||
{
|
||||
}
|
||||
}
|
||||
public override double 肥大
|
||||
{
|
||||
set
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public override double 身長
|
||||
{
|
||||
set
|
||||
{
|
||||
}
|
||||
}
|
||||
public override double 身長
|
||||
{
|
||||
set
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public キャップ2(double DisUnit, 配色指定 配色指定, 体配色 体配色, Med Med, キャップ2D e)
|
||||
{
|
||||
ThisType = GetType();
|
||||
本体 = new Difs(Sta.胴体["キャップ左"]);
|
||||
Pars pars = 本体[0][0];
|
||||
X0Y0_根本 = pars["根本"].ToPar();
|
||||
X0Y0_先端 = pars["先端"].ToPar();
|
||||
本体.SetJoints();
|
||||
接続根 = new JointD(本体);
|
||||
右 = e.右;
|
||||
反転X = e.反転X;
|
||||
反転Y = e.反転Y;
|
||||
基準C = e.基準C;
|
||||
位置C = e.位置C;
|
||||
角度B = e.角度B;
|
||||
角度C = e.角度C;
|
||||
尺度B = e.尺度B;
|
||||
尺度C = e.尺度C;
|
||||
尺度XB = e.尺度XB;
|
||||
尺度XC = e.尺度XC;
|
||||
尺度YB = e.尺度YB;
|
||||
尺度YC = e.尺度YC;
|
||||
肥大 = e.肥大;
|
||||
身長 = e.身長;
|
||||
Xv = e.Xv;
|
||||
Yv = e.Yv;
|
||||
Xi = e.Xi;
|
||||
Yi = e.Yi;
|
||||
サイズ = e.サイズ;
|
||||
サイズX = e.サイズX;
|
||||
サイズY = e.サイズY;
|
||||
根本_表示 = e.根本_表示;
|
||||
先端_表示 = e.先端_表示;
|
||||
欠損 = e.欠損;
|
||||
筋肉 = e.筋肉;
|
||||
拘束 = e.拘束;
|
||||
if (!e.表示)
|
||||
{
|
||||
表示 = false;
|
||||
}
|
||||
base.配色指定 = 配色指定;
|
||||
配色(体配色);
|
||||
X0Y0_根本CP = new ColorP(X0Y0_根本, 根本CD, DisUnit, abj: true);
|
||||
X0Y0_先端CP = new ColorP(X0Y0_先端, 先端CD, DisUnit, abj: true);
|
||||
濃度 = e.濃度;
|
||||
}
|
||||
public キャップ2(double DisUnit, 配色指定 配色指定, 体配色 体配色, Med Med, キャップ2D e)
|
||||
{
|
||||
ThisType = GetType();
|
||||
本体 = new Difs(Sta.胴体["キャップ左"]);
|
||||
Pars pars = 本体[0][0];
|
||||
X0Y0_根本 = pars["根本"].ToPar();
|
||||
X0Y0_先端 = pars["先端"].ToPar();
|
||||
本体.SetJoints();
|
||||
接続根 = new JointD(本体);
|
||||
右 = e.右;
|
||||
反転X = e.反転X;
|
||||
反転Y = e.反転Y;
|
||||
基準C = e.基準C;
|
||||
位置C = e.位置C;
|
||||
角度B = e.角度B;
|
||||
角度C = e.角度C;
|
||||
尺度B = e.尺度B;
|
||||
尺度C = e.尺度C;
|
||||
尺度XB = e.尺度XB;
|
||||
尺度XC = e.尺度XC;
|
||||
尺度YB = e.尺度YB;
|
||||
尺度YC = e.尺度YC;
|
||||
肥大 = e.肥大;
|
||||
身長 = e.身長;
|
||||
Xv = e.Xv;
|
||||
Yv = e.Yv;
|
||||
Xi = e.Xi;
|
||||
Yi = e.Yi;
|
||||
サイズ = e.サイズ;
|
||||
サイズX = e.サイズX;
|
||||
サイズY = e.サイズY;
|
||||
根本_表示 = e.根本_表示;
|
||||
先端_表示 = e.先端_表示;
|
||||
欠損 = e.欠損;
|
||||
筋肉 = e.筋肉;
|
||||
拘束 = e.拘束;
|
||||
if (!e.表示)
|
||||
{
|
||||
表示 = false;
|
||||
}
|
||||
base.配色指定 = 配色指定;
|
||||
配色(体配色);
|
||||
X0Y0_根本CP = new ColorP(X0Y0_根本, 根本CD, DisUnit, abj: true);
|
||||
X0Y0_先端CP = new ColorP(X0Y0_先端, 先端CD, DisUnit, abj: true);
|
||||
濃度 = e.濃度;
|
||||
}
|
||||
|
||||
public override void 色更新()
|
||||
{
|
||||
X0Y0_根本CP.Update();
|
||||
X0Y0_先端CP.Update();
|
||||
}
|
||||
public override void 色更新()
|
||||
{
|
||||
X0Y0_根本CP.Update();
|
||||
X0Y0_先端CP.Update();
|
||||
}
|
||||
|
||||
private void 配色(体配色 体配色)
|
||||
{
|
||||
配色N0(体配色);
|
||||
}
|
||||
private void 配色(体配色 体配色)
|
||||
{
|
||||
配色N0(体配色);
|
||||
}
|
||||
|
||||
private void 配色N0(体配色 体配色)
|
||||
{
|
||||
根本CD = new ColorD();
|
||||
先端CD = new ColorD();
|
||||
}
|
||||
private void 配色N0(体配色 体配色)
|
||||
{
|
||||
根本CD = new ColorD();
|
||||
先端CD = new ColorD();
|
||||
}
|
||||
|
||||
public void 配色(キャップ色 配色)
|
||||
{
|
||||
根本CD.色 = 配色.根本色;
|
||||
先端CD.色 = 配色.先端色;
|
||||
}
|
||||
public void 配色(キャップ色 配色)
|
||||
{
|
||||
根本CD.色 = 配色.根本色;
|
||||
先端CD.色 = 配色.先端色;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,22 +1,23 @@
|
||||
using System;
|
||||
using _2DGAMELIB;
|
||||
|
||||
namespace SlaveMatrix;
|
||||
|
||||
[Serializable]
|
||||
public class キャップ2D : EleD
|
||||
namespace SlaveMatrix
|
||||
{
|
||||
public bool 根本_表示;
|
||||
[Serializable]
|
||||
public class キャップ2D : EleD
|
||||
{
|
||||
public bool 根本_表示;
|
||||
|
||||
public bool 先端_表示;
|
||||
public bool 先端_表示;
|
||||
|
||||
public キャップ2D()
|
||||
{
|
||||
ThisType = GetType();
|
||||
}
|
||||
public キャップ2D()
|
||||
{
|
||||
ThisType = GetType();
|
||||
}
|
||||
|
||||
public override Ele GetEle(double DisUnit, Med Med, 体配色 体配色)
|
||||
{
|
||||
return new キャップ2(DisUnit, 配色指定, 体配色, Med, this);
|
||||
}
|
||||
public override Ele GetEle(double DisUnit, Med Med, 体配色 体配色)
|
||||
{
|
||||
return new キャップ2(DisUnit, 配色指定, 体配色, Med, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,27 +1,28 @@
|
||||
using System;
|
||||
|
||||
namespace SlaveMatrix;
|
||||
|
||||
[Serializable]
|
||||
public struct キャップ情報
|
||||
namespace SlaveMatrix
|
||||
{
|
||||
public bool 根本_表示;
|
||||
[Serializable]
|
||||
public struct キャップ情報
|
||||
{
|
||||
public bool 根本_表示;
|
||||
|
||||
public bool 先端_表示;
|
||||
public bool 先端_表示;
|
||||
|
||||
public キャップ色 色;
|
||||
public キャップ色 色;
|
||||
|
||||
public void SetDefault()
|
||||
{
|
||||
根本_表示 = true;
|
||||
先端_表示 = true;
|
||||
色.SetDefault();
|
||||
}
|
||||
public void SetDefault()
|
||||
{
|
||||
根本_表示 = true;
|
||||
先端_表示 = true;
|
||||
色.SetDefault();
|
||||
}
|
||||
|
||||
public static キャップ情報 GetDefault()
|
||||
{
|
||||
キャップ情報 result = default(キャップ情報);
|
||||
result.SetDefault();
|
||||
return result;
|
||||
}
|
||||
public static キャップ情報 GetDefault()
|
||||
{
|
||||
キャップ情報 result = default(キャップ情報);
|
||||
result.SetDefault();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,36 +1,37 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
|
||||
namespace SlaveMatrix;
|
||||
|
||||
[Serializable]
|
||||
public struct キャップ色
|
||||
namespace SlaveMatrix
|
||||
{
|
||||
public Color 根本;
|
||||
[Serializable]
|
||||
public struct キャップ色
|
||||
{
|
||||
public Color 根本;
|
||||
|
||||
public Color 先端;
|
||||
public Color 先端;
|
||||
|
||||
public Color2 根本色;
|
||||
public Color2 根本色;
|
||||
|
||||
public Color2 先端色;
|
||||
public Color2 先端色;
|
||||
|
||||
public void SetDefault()
|
||||
{
|
||||
根本 = Color.HotPink;
|
||||
先端 = Color.HotPink;
|
||||
SetColor2();
|
||||
}
|
||||
public void SetDefault()
|
||||
{
|
||||
根本 = Color.HotPink;
|
||||
先端 = Color.HotPink;
|
||||
SetColor2();
|
||||
}
|
||||
|
||||
public void SetRandom()
|
||||
{
|
||||
Col.GetRandomClothesColor(out 根本);
|
||||
先端 = 根本;
|
||||
SetColor2();
|
||||
}
|
||||
public void SetRandom()
|
||||
{
|
||||
Col.GetRandomClothesColor(out 根本);
|
||||
先端 = 根本;
|
||||
SetColor2();
|
||||
}
|
||||
|
||||
public void SetColor2()
|
||||
{
|
||||
Col.GetGrad(ref 根本, out 根本色);
|
||||
Col.GetGrad(ref 先端, out 先端色);
|
||||
}
|
||||
public void SetColor2()
|
||||
{
|
||||
Col.GetGrad(ref 根本, out 根本色);
|
||||
Col.GetGrad(ref 先端, out 先端色);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,29 +1,30 @@
|
||||
using _2DGAMELIB;
|
||||
|
||||
namespace SlaveMatrix;
|
||||
|
||||
public class キャラ台詞
|
||||
namespace SlaveMatrix
|
||||
{
|
||||
private Med Med;
|
||||
public class キャラ台詞
|
||||
{
|
||||
private Med Med;
|
||||
|
||||
private 吹き出し hd;
|
||||
private 吹き出し hd;
|
||||
|
||||
public キャラ台詞(Med Med, 吹き出し hd)
|
||||
{
|
||||
this.Med = Med;
|
||||
this.hd = hd;
|
||||
}
|
||||
public キャラ台詞(Med Med, 吹き出し hd)
|
||||
{
|
||||
this.Med = Med;
|
||||
this.hd = hd;
|
||||
}
|
||||
|
||||
public void Set()
|
||||
{
|
||||
string text = "";
|
||||
text = hd.Text;
|
||||
hd.Text = text;
|
||||
}
|
||||
public void Set()
|
||||
{
|
||||
string text = "";
|
||||
text = hd.Text;
|
||||
hd.Text = text;
|
||||
}
|
||||
|
||||
public void Set状態()
|
||||
{
|
||||
string 点6ハート = GameText.点6ハート;
|
||||
hd.Text = 点6ハート;
|
||||
}
|
||||
public void Set状態()
|
||||
{
|
||||
string 点6ハート = GameText.点6ハート;
|
||||
hd.Text = 点6ハート;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,36 +1,37 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
|
||||
namespace SlaveMatrix;
|
||||
|
||||
[Serializable]
|
||||
public struct クロスB色
|
||||
namespace SlaveMatrix
|
||||
{
|
||||
public Color 生地1;
|
||||
[Serializable]
|
||||
public struct クロスB色
|
||||
{
|
||||
public Color 生地1;
|
||||
|
||||
public Color 生地2;
|
||||
public Color 生地2;
|
||||
|
||||
public Color2 生地1色;
|
||||
public Color2 生地1色;
|
||||
|
||||
public Color2 生地2色;
|
||||
public Color2 生地2色;
|
||||
|
||||
public void SetDefault()
|
||||
{
|
||||
生地1 = Color.OldLace;
|
||||
生地2 = Color.OldLace;
|
||||
SetColor2();
|
||||
}
|
||||
public void SetDefault()
|
||||
{
|
||||
生地1 = Color.OldLace;
|
||||
生地2 = Color.OldLace;
|
||||
SetColor2();
|
||||
}
|
||||
|
||||
public void SetRandom()
|
||||
{
|
||||
Col.GetRandomClothesColor(out 生地1);
|
||||
生地2 = 生地1;
|
||||
SetColor2();
|
||||
}
|
||||
public void SetRandom()
|
||||
{
|
||||
Col.GetRandomClothesColor(out 生地1);
|
||||
生地2 = 生地1;
|
||||
SetColor2();
|
||||
}
|
||||
|
||||
public void SetColor2()
|
||||
{
|
||||
Col.GetGrad(ref 生地1, out 生地1色);
|
||||
Col.GetGrad(ref 生地2, out 生地2色);
|
||||
}
|
||||
public void SetColor2()
|
||||
{
|
||||
Col.GetGrad(ref 生地1, out 生地1色);
|
||||
Col.GetGrad(ref 生地2, out 生地2色);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,36 +1,37 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
|
||||
namespace SlaveMatrix;
|
||||
|
||||
[Serializable]
|
||||
public struct クロスT色
|
||||
namespace SlaveMatrix
|
||||
{
|
||||
public Color 生地;
|
||||
[Serializable]
|
||||
public struct クロスT色
|
||||
{
|
||||
public Color 生地;
|
||||
|
||||
public Color 縁;
|
||||
public Color 縁;
|
||||
|
||||
public Color2 生地色;
|
||||
public Color2 生地色;
|
||||
|
||||
public Color2 縁色;
|
||||
public Color2 縁色;
|
||||
|
||||
public void SetDefault()
|
||||
{
|
||||
生地 = Color.OldLace;
|
||||
縁 = Color.OldLace;
|
||||
SetColor2();
|
||||
}
|
||||
public void SetDefault()
|
||||
{
|
||||
生地 = Color.OldLace;
|
||||
縁 = Color.OldLace;
|
||||
SetColor2();
|
||||
}
|
||||
|
||||
public void SetRandom()
|
||||
{
|
||||
Col.GetRandomClothesColor(out 生地);
|
||||
縁 = 生地;
|
||||
SetColor2();
|
||||
}
|
||||
public void SetRandom()
|
||||
{
|
||||
Col.GetRandomClothesColor(out 生地);
|
||||
縁 = 生地;
|
||||
SetColor2();
|
||||
}
|
||||
|
||||
public void SetColor2()
|
||||
{
|
||||
Col.GetGrad(ref 生地, out 生地色);
|
||||
Col.GetGrad(ref 縁, out 縁色);
|
||||
}
|
||||
public void SetColor2()
|
||||
{
|
||||
Col.GetGrad(ref 生地, out 生地色);
|
||||
Col.GetGrad(ref 縁, out 縁色);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
namespace SlaveMatrix;
|
||||
|
||||
public class サイド : 後髪1
|
||||
namespace SlaveMatrix
|
||||
{
|
||||
public class サイド : 後髪1
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
using System;
|
||||
|
||||
namespace SlaveMatrix;
|
||||
|
||||
[Serializable]
|
||||
public class サイドD : 後髪1D
|
||||
namespace SlaveMatrix
|
||||
{
|
||||
[Serializable]
|
||||
public class サイドD : 後髪1D
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,96 +3,97 @@ using System.Drawing;
|
||||
using System.Linq;
|
||||
using _2DGAMELIB;
|
||||
|
||||
namespace SlaveMatrix;
|
||||
|
||||
public class スタンプB : Stamp
|
||||
namespace SlaveMatrix
|
||||
{
|
||||
private Mot ぶっかけ垂れ;
|
||||
public class スタンプB : Stamp
|
||||
{
|
||||
private Mot ぶっかけ垂れ;
|
||||
|
||||
public override void Draw(Are Are)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (sta.Count <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
foreach (sep stum in sta)
|
||||
{
|
||||
if (stum.Sta.表示)
|
||||
{
|
||||
p = stum.Ele.本体.Current.GetPar(stum.Path);
|
||||
stum.Sta.位置B = p.ToGlobal(stum.Pos);
|
||||
stum.Sta.色更新();
|
||||
stum.Sta.本体.Draw(Are);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
public override void Draw(Are Are)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (sta.Count <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
foreach (sep stum in sta)
|
||||
{
|
||||
if (stum.Sta.表示)
|
||||
{
|
||||
p = stum.Ele.本体.Current.GetPar(stum.Path);
|
||||
stum.Sta.位置B = p.ToGlobal(stum.Pos);
|
||||
stum.Sta.色更新();
|
||||
stum.Sta.本体.Draw(Are);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public void Add(Vector2D cp, Color hc, Dictionary<Ele, List<Ele>> 参照)
|
||||
{
|
||||
he = Bod.GetHitEle(hc);
|
||||
if (チェック2(he))
|
||||
{
|
||||
if (sta.Count >= 33)
|
||||
{
|
||||
sep = sta[0];
|
||||
sta.RemoveAt(0);
|
||||
sep.Sta.Dispose();
|
||||
}
|
||||
sep = default(sep);
|
||||
sep.Sta = EleD.GetEle(Are.DisUnit, Med, Sta.GameData.配色);
|
||||
sep.Sta.SetHitFalse();
|
||||
sep.Sta.Xv = RNG.XS.NextDouble();
|
||||
sep.Sta.右 = RNG.XS.NextBool();
|
||||
sep.Ele = he;
|
||||
sep.Par = he.本体.GetHitPar_(hc);
|
||||
sep.Path = sep.Par.GetPath();
|
||||
sep.Pos = sep.Par.ToLocal(cp);
|
||||
if (参照.ContainsKey(he))
|
||||
{
|
||||
参照[he].Add(sep.Sta);
|
||||
}
|
||||
else
|
||||
{
|
||||
参照[he] = new List<Ele> { sep.Sta };
|
||||
}
|
||||
sta.Add(sep);
|
||||
ぶっかけ垂れ.Start();
|
||||
}
|
||||
}
|
||||
public void Add(Vector2D cp, Color hc, Dictionary<Ele, List<Ele>> 参照)
|
||||
{
|
||||
he = Bod.GetHitEle(hc);
|
||||
if (チェック2(he))
|
||||
{
|
||||
if (sta.Count >= 33)
|
||||
{
|
||||
sep = sta[0];
|
||||
sta.RemoveAt(0);
|
||||
sep.Sta.Dispose();
|
||||
}
|
||||
sep = default(sep);
|
||||
sep.Sta = EleD.GetEle(Are.DisUnit, Med, Sta.GameData.配色);
|
||||
sep.Sta.SetHitFalse();
|
||||
sep.Sta.Xv = RNG.XS.NextDouble();
|
||||
sep.Sta.右 = RNG.XS.NextBool();
|
||||
sep.Ele = he;
|
||||
sep.Par = he.本体.GetHitPar_(hc);
|
||||
sep.Path = sep.Par.GetPath();
|
||||
sep.Pos = sep.Par.ToLocal(cp);
|
||||
if (参照.ContainsKey(he))
|
||||
{
|
||||
参照[he].Add(sep.Sta);
|
||||
}
|
||||
else
|
||||
{
|
||||
参照[he] = new List<Ele> { sep.Sta };
|
||||
}
|
||||
sta.Add(sep);
|
||||
ぶっかけ垂れ.Start();
|
||||
}
|
||||
}
|
||||
|
||||
public スタンプB(Med Med, Are Are, Cha Cha, Bod Bod, EleD EleD, Mots Mots)
|
||||
: base(Med, Are, Cha, Bod, EleD)
|
||||
{
|
||||
Ele e = null;
|
||||
ぶっかけ垂れ = new Mot(0.0, 1.0)
|
||||
{
|
||||
BaseSpeed = 1.0,
|
||||
Staing = delegate(Mot m)
|
||||
{
|
||||
e = sta.Last().Sta;
|
||||
m.Max = RNG.XS.NextDouble();
|
||||
},
|
||||
Runing = delegate(Mot m)
|
||||
{
|
||||
e.Yv = m.Value;
|
||||
},
|
||||
Reaing = delegate(Mot m)
|
||||
{
|
||||
m.End();
|
||||
},
|
||||
Rouing = delegate
|
||||
{
|
||||
},
|
||||
Ending = delegate
|
||||
{
|
||||
}
|
||||
};
|
||||
Mots.Add(EleD.GetHashCode().ToString(), ぶっかけ垂れ);
|
||||
}
|
||||
public スタンプB(Med Med, Are Are, Cha Cha, Bod Bod, EleD EleD, Mots Mots)
|
||||
: base(Med, Are, Cha, Bod, EleD)
|
||||
{
|
||||
Ele e = null;
|
||||
ぶっかけ垂れ = new Mot(0.0, 1.0)
|
||||
{
|
||||
BaseSpeed = 1.0,
|
||||
Staing = delegate(Mot m)
|
||||
{
|
||||
e = sta.Last().Sta;
|
||||
m.Max = RNG.XS.NextDouble();
|
||||
},
|
||||
Runing = delegate(Mot m)
|
||||
{
|
||||
e.Yv = m.Value;
|
||||
},
|
||||
Reaing = delegate(Mot m)
|
||||
{
|
||||
m.End();
|
||||
},
|
||||
Rouing = delegate
|
||||
{
|
||||
},
|
||||
Ending = delegate
|
||||
{
|
||||
}
|
||||
};
|
||||
Mots.Add(EleD.GetHashCode().ToString(), ぶっかけ垂れ);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,65 +1,66 @@
|
||||
using System.Drawing;
|
||||
using _2DGAMELIB;
|
||||
|
||||
namespace SlaveMatrix;
|
||||
|
||||
public class スタンプK : Stamp
|
||||
namespace SlaveMatrix
|
||||
{
|
||||
private Ele Par;
|
||||
public class スタンプK : Stamp
|
||||
{
|
||||
private Ele Par;
|
||||
|
||||
public override void Draw(Are Are)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (sta.Count <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
foreach (sep stum in sta)
|
||||
{
|
||||
p = stum.Ele.本体.Current.GetPar(stum.Path);
|
||||
stum.Sta.角度B = p.AngleBase - stum.Par.AngleBase;
|
||||
stum.Sta.位置B = p.ToGlobal(stum.Pos);
|
||||
stum.Sta.色更新();
|
||||
stum.Sta.本体.Draw(Are);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
public override void Draw(Are Are)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (sta.Count <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
foreach (sep stum in sta)
|
||||
{
|
||||
p = stum.Ele.本体.Current.GetPar(stum.Path);
|
||||
stum.Sta.角度B = p.AngleBase - stum.Par.AngleBase;
|
||||
stum.Sta.位置B = p.ToGlobal(stum.Pos);
|
||||
stum.Sta.色更新();
|
||||
stum.Sta.本体.Draw(Are);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public キスマーク Add(Vector2D cp, Color hc, Ele he)
|
||||
{
|
||||
if (チェック1(he) && he == Par)
|
||||
{
|
||||
p = he.本体.GetHitPar_(hc);
|
||||
c2 = he.GetParOfColorP(p).ColorD.色;
|
||||
if (c2.Col1 == Cha.配色.人肌O.Col1 || c2.Col2 == Cha.配色.人肌O.Col1)
|
||||
{
|
||||
if (sta.Count >= 33)
|
||||
{
|
||||
sep = sta[0];
|
||||
sta.RemoveAt(0);
|
||||
sep.Sta.Dispose();
|
||||
}
|
||||
sep = default(sep);
|
||||
sep.Sta = EleD.GetEle(Are.DisUnit, Med, Cha.配色);
|
||||
sep.Sta.SetHitFalse();
|
||||
sep.Ele = he;
|
||||
sep.Par = p;
|
||||
sep.Path = sep.Par.GetPath();
|
||||
sep.Pos = sep.Par.ToLocal(cp);
|
||||
sta.Add(sep);
|
||||
}
|
||||
return (キスマーク)sep.Sta;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public キスマーク Add(Vector2D cp, Color hc, Ele he)
|
||||
{
|
||||
if (チェック1(he) && he == Par)
|
||||
{
|
||||
p = he.本体.GetHitPar_(hc);
|
||||
c2 = he.GetParOfColorP(p).ColorD.色;
|
||||
if (c2.Col1 == Cha.配色.人肌O.Col1 || c2.Col2 == Cha.配色.人肌O.Col1)
|
||||
{
|
||||
if (sta.Count >= 33)
|
||||
{
|
||||
sep = sta[0];
|
||||
sta.RemoveAt(0);
|
||||
sep.Sta.Dispose();
|
||||
}
|
||||
sep = default(sep);
|
||||
sep.Sta = EleD.GetEle(Are.DisUnit, Med, Cha.配色);
|
||||
sep.Sta.SetHitFalse();
|
||||
sep.Ele = he;
|
||||
sep.Par = p;
|
||||
sep.Path = sep.Par.GetPath();
|
||||
sep.Pos = sep.Par.ToLocal(cp);
|
||||
sta.Add(sep);
|
||||
}
|
||||
return (キスマーク)sep.Sta;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public スタンプK(Med Med, Are Are, Cha Cha, Bod Bod, EleD EleD, Ele Par)
|
||||
: base(Med, Are, Cha, Bod, EleD)
|
||||
{
|
||||
this.Par = Par;
|
||||
}
|
||||
public スタンプK(Med Med, Are Are, Cha Cha, Bod Bod, EleD EleD, Ele Par)
|
||||
: base(Med, Are, Cha, Bod, EleD)
|
||||
{
|
||||
this.Par = Par;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,67 +1,68 @@
|
||||
using System.Drawing;
|
||||
using _2DGAMELIB;
|
||||
|
||||
namespace SlaveMatrix;
|
||||
|
||||
public class スタンプW : Stamp
|
||||
namespace SlaveMatrix
|
||||
{
|
||||
private Ele Par;
|
||||
public class スタンプW : Stamp
|
||||
{
|
||||
private Ele Par;
|
||||
|
||||
public override void Draw(Are Are)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (sta.Count <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
foreach (sep stum in sta)
|
||||
{
|
||||
p = stum.Ele.本体.Current.GetPar(stum.Path);
|
||||
stum.Sta.角度B = p.AngleBase - stum.Par.AngleBase;
|
||||
stum.Sta.位置B = p.ToGlobal(stum.Pos);
|
||||
stum.Sta.色更新();
|
||||
stum.Sta.本体.Draw(Are);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
public override void Draw(Are Are)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (sta.Count <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
foreach (sep stum in sta)
|
||||
{
|
||||
p = stum.Ele.本体.Current.GetPar(stum.Path);
|
||||
stum.Sta.角度B = p.AngleBase - stum.Par.AngleBase;
|
||||
stum.Sta.位置B = p.ToGlobal(stum.Pos);
|
||||
stum.Sta.色更新();
|
||||
stum.Sta.本体.Draw(Are);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public bool Add(Vector2D cp, Color hc, Ele he)
|
||||
{
|
||||
if (チェック2(he) && he == Par)
|
||||
{
|
||||
p = he.本体.GetHitPar_(hc);
|
||||
c2 = he.GetParOfColorP(p).ColorD.色;
|
||||
if (c2.Col1 == Cha.配色.人肌O.Col1 || c2.Col2 == Cha.配色.人肌O.Col1)
|
||||
{
|
||||
if (sta.Count >= 33)
|
||||
{
|
||||
sep = sta[0];
|
||||
sta.RemoveAt(0);
|
||||
sep.Sta.Dispose();
|
||||
}
|
||||
sep = default(sep);
|
||||
sep.Sta = EleD.GetEle(Are.DisUnit, Med, Cha.配色);
|
||||
sep.Sta.SetHitFalse();
|
||||
sep.Sta.角度C = 45.0 * (double)(RNG.XS.NextBool() ? 1 : (-1)) * RNG.XS.NextDouble();
|
||||
sep.Ele = he;
|
||||
sep.Par = p;
|
||||
sep.Path = sep.Par.GetPath();
|
||||
sep.Pos = sep.Par.ToLocal(cp + (he.位置 - cp).newNormalize() * 0.01);
|
||||
sta.Add(sep);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public bool Add(Vector2D cp, Color hc, Ele he)
|
||||
{
|
||||
if (チェック2(he) && he == Par)
|
||||
{
|
||||
p = he.本体.GetHitPar_(hc);
|
||||
c2 = he.GetParOfColorP(p).ColorD.色;
|
||||
if (c2.Col1 == Cha.配色.人肌O.Col1 || c2.Col2 == Cha.配色.人肌O.Col1)
|
||||
{
|
||||
if (sta.Count >= 33)
|
||||
{
|
||||
sep = sta[0];
|
||||
sta.RemoveAt(0);
|
||||
sep.Sta.Dispose();
|
||||
}
|
||||
sep = default(sep);
|
||||
sep.Sta = EleD.GetEle(Are.DisUnit, Med, Cha.配色);
|
||||
sep.Sta.SetHitFalse();
|
||||
sep.Sta.角度C = 45.0 * (double)(RNG.XS.NextBool() ? 1 : (-1)) * RNG.XS.NextDouble();
|
||||
sep.Ele = he;
|
||||
sep.Par = p;
|
||||
sep.Path = sep.Par.GetPath();
|
||||
sep.Pos = sep.Par.ToLocal(cp + (he.位置 - cp).newNormalize() * 0.01);
|
||||
sta.Add(sep);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public スタンプW(Med Med, Are Are, Cha Cha, Bod Bod, EleD EleD, Ele Par)
|
||||
: base(Med, Are, Cha, Bod, EleD)
|
||||
{
|
||||
this.Par = Par;
|
||||
EleD.尺度B = 0.9;
|
||||
}
|
||||
public スタンプW(Med Med, Are Are, Cha Cha, Bod Bod, EleD EleD, Ele Par)
|
||||
: base(Med, Are, Cha, Bod, EleD)
|
||||
{
|
||||
this.Par = Par;
|
||||
EleD.尺度B = 0.9;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,36 +1,37 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
|
||||
namespace SlaveMatrix;
|
||||
|
||||
[Serializable]
|
||||
public struct チューブT色
|
||||
namespace SlaveMatrix
|
||||
{
|
||||
public Color 生地;
|
||||
[Serializable]
|
||||
public struct チューブT色
|
||||
{
|
||||
public Color 生地;
|
||||
|
||||
public Color 縁;
|
||||
public Color 縁;
|
||||
|
||||
public Color2 生地色;
|
||||
public Color2 生地色;
|
||||
|
||||
public Color2 縁色;
|
||||
public Color2 縁色;
|
||||
|
||||
public void SetDefault()
|
||||
{
|
||||
生地 = Color.OldLace;
|
||||
縁 = Color.OldLace;
|
||||
SetColor2();
|
||||
}
|
||||
public void SetDefault()
|
||||
{
|
||||
生地 = Color.OldLace;
|
||||
縁 = Color.OldLace;
|
||||
SetColor2();
|
||||
}
|
||||
|
||||
public void SetRandom()
|
||||
{
|
||||
Col.GetRandomClothesColor(out 生地);
|
||||
縁 = 生地;
|
||||
SetColor2();
|
||||
}
|
||||
public void SetRandom()
|
||||
{
|
||||
Col.GetRandomClothesColor(out 生地);
|
||||
縁 = 生地;
|
||||
SetColor2();
|
||||
}
|
||||
|
||||
public void SetColor2()
|
||||
{
|
||||
Col.GetGrad(ref 生地, out 生地色);
|
||||
Col.GetGrad(ref 縁, out 縁色);
|
||||
}
|
||||
public void SetColor2()
|
||||
{
|
||||
Col.GetGrad(ref 生地, out 生地色);
|
||||
Col.GetGrad(ref 縁, out 縁色);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,39 +1,40 @@
|
||||
using System;
|
||||
|
||||
namespace SlaveMatrix;
|
||||
|
||||
[Serializable]
|
||||
public struct ドレス情報
|
||||
namespace SlaveMatrix
|
||||
{
|
||||
public 上着T_ドレス情報 T;
|
||||
[Serializable]
|
||||
public struct ドレス情報
|
||||
{
|
||||
public 上着T_ドレス情報 T;
|
||||
|
||||
public 上着M_ドレス情報 M;
|
||||
public 上着M_ドレス情報 M;
|
||||
|
||||
public ドレス色 色;
|
||||
public ドレス色 色;
|
||||
|
||||
public bool IsShow
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!T.IsShow)
|
||||
{
|
||||
return M.IsShow;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
public bool IsShow
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!T.IsShow)
|
||||
{
|
||||
return M.IsShow;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetDefault()
|
||||
{
|
||||
T.SetDefault();
|
||||
M.SetDefault();
|
||||
色.SetDefault();
|
||||
}
|
||||
public void SetDefault()
|
||||
{
|
||||
T.SetDefault();
|
||||
M.SetDefault();
|
||||
色.SetDefault();
|
||||
}
|
||||
|
||||
public static ドレス情報 GetDefault()
|
||||
{
|
||||
ドレス情報 result = default(ドレス情報);
|
||||
result.SetDefault();
|
||||
return result;
|
||||
}
|
||||
public static ドレス情報 GetDefault()
|
||||
{
|
||||
ドレス情報 result = default(ドレス情報);
|
||||
result.SetDefault();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,50 +1,51 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
|
||||
namespace SlaveMatrix;
|
||||
|
||||
[Serializable]
|
||||
public struct ドレス色
|
||||
namespace SlaveMatrix
|
||||
{
|
||||
public Color 生地;
|
||||
[Serializable]
|
||||
public struct ドレス色
|
||||
{
|
||||
public Color 生地;
|
||||
|
||||
public Color 柄;
|
||||
public Color 柄;
|
||||
|
||||
public Color 縁;
|
||||
public Color 縁;
|
||||
|
||||
public Color 紐;
|
||||
public Color 紐;
|
||||
|
||||
public Color2 生地色;
|
||||
public Color2 生地色;
|
||||
|
||||
public Color2 柄色;
|
||||
public Color2 柄色;
|
||||
|
||||
public Color2 縁色;
|
||||
public Color2 縁色;
|
||||
|
||||
public Color2 紐色;
|
||||
public Color2 紐色;
|
||||
|
||||
public void SetDefault()
|
||||
{
|
||||
Col.Add(ref Col.DarkGreen, 0, 0, -50, out 生地);
|
||||
柄 = Color.Gold;
|
||||
縁 = Color.Gold;
|
||||
紐 = Col.Black;
|
||||
SetColor2();
|
||||
}
|
||||
public void SetDefault()
|
||||
{
|
||||
Col.Add(ref Col.DarkGreen, 0, 0, -50, out 生地);
|
||||
柄 = Color.Gold;
|
||||
縁 = Color.Gold;
|
||||
紐 = Col.Black;
|
||||
SetColor2();
|
||||
}
|
||||
|
||||
public void SetRandom()
|
||||
{
|
||||
Col.GetRandomClothesColor(out 生地);
|
||||
Col.GetRandomClothesColor(out 柄);
|
||||
縁 = 柄;
|
||||
Col.GetRandomClothesColor(out 紐);
|
||||
SetColor2();
|
||||
}
|
||||
public void SetRandom()
|
||||
{
|
||||
Col.GetRandomClothesColor(out 生地);
|
||||
Col.GetRandomClothesColor(out 柄);
|
||||
縁 = 柄;
|
||||
Col.GetRandomClothesColor(out 紐);
|
||||
SetColor2();
|
||||
}
|
||||
|
||||
public void SetColor2()
|
||||
{
|
||||
Col.GetGrad(ref 生地, out 生地色);
|
||||
Col.GetGrad(ref 柄, out 柄色);
|
||||
Col.GetGrad(ref 縁, out 縁色);
|
||||
Col.GetGrad(ref 紐, out 紐色);
|
||||
}
|
||||
public void SetColor2()
|
||||
{
|
||||
Col.GetGrad(ref 生地, out 生地色);
|
||||
Col.GetGrad(ref 柄, out 柄色);
|
||||
Col.GetGrad(ref 縁, out 縁色);
|
||||
Col.GetGrad(ref 紐, out 紐色);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,49 +1,50 @@
|
||||
using _2DGAMELIB;
|
||||
|
||||
namespace SlaveMatrix;
|
||||
|
||||
public class ドレス色更新
|
||||
namespace SlaveMatrix
|
||||
{
|
||||
public 上着トップ_ドレス トップ;
|
||||
public class ドレス色更新
|
||||
{
|
||||
public 上着トップ_ドレス トップ;
|
||||
|
||||
public 上着ミドル_ドレス ミドル;
|
||||
public 上着ミドル_ドレス ミドル;
|
||||
|
||||
private Par[] ドレス;
|
||||
private Par[] ドレス;
|
||||
|
||||
private Par[] 縁左;
|
||||
private Par[] 縁左;
|
||||
|
||||
private Par[] 縁右;
|
||||
private Par[] 縁右;
|
||||
|
||||
private Vector2D[] ドレスm;
|
||||
private Vector2D[] ドレスm;
|
||||
|
||||
private Vector2D[] 縁左m;
|
||||
private Vector2D[] 縁左m;
|
||||
|
||||
private Vector2D[] 縁右m;
|
||||
private Vector2D[] 縁右m;
|
||||
|
||||
public ドレス色更新(上着トップ_ドレス トップ, 上着ミドル_ドレス ミドル)
|
||||
{
|
||||
this.トップ = トップ;
|
||||
this.ミドル = ミドル;
|
||||
ドレス = new Par[5] { トップ.X0Y0_左_服, トップ.X0Y0_左_バスト, トップ.X0Y0_右_服, トップ.X0Y0_右_バスト, ミドル.X0Y0_服 };
|
||||
縁左 = new Par[2] { トップ.X0Y0_左_縁, ミドル.X0Y0_縁_縁左 };
|
||||
縁右 = new Par[2] { トップ.X0Y0_右_縁, ミドル.X0Y0_縁_縁右 };
|
||||
}
|
||||
public ドレス色更新(上着トップ_ドレス トップ, 上着ミドル_ドレス ミドル)
|
||||
{
|
||||
this.トップ = トップ;
|
||||
this.ミドル = ミドル;
|
||||
ドレス = new Par[5] { トップ.X0Y0_左_服, トップ.X0Y0_左_バスト, トップ.X0Y0_右_服, トップ.X0Y0_右_バスト, ミドル.X0Y0_服 };
|
||||
縁左 = new Par[2] { トップ.X0Y0_左_縁, ミドル.X0Y0_縁_縁左 };
|
||||
縁右 = new Par[2] { トップ.X0Y0_右_縁, ミドル.X0Y0_縁_縁右 };
|
||||
}
|
||||
|
||||
public void 色更新()
|
||||
{
|
||||
ドレス.GetMiY_MaY(out ドレスm);
|
||||
縁左.GetMiY_MaY(out 縁左m);
|
||||
縁右.GetMiY_MaY(out 縁右m);
|
||||
トップ.色更新(ドレスm, 縁左m, 縁右m);
|
||||
ミドル.色更新(ドレスm, 縁左m, 縁右m);
|
||||
}
|
||||
public void 色更新()
|
||||
{
|
||||
ドレス.GetMiY_MaY(out ドレスm);
|
||||
縁左.GetMiY_MaY(out 縁左m);
|
||||
縁右.GetMiY_MaY(out 縁右m);
|
||||
トップ.色更新(ドレスm, 縁左m, 縁右m);
|
||||
ミドル.色更新(ドレスm, 縁左m, 縁右m);
|
||||
}
|
||||
|
||||
public bool Contains(Ele e)
|
||||
{
|
||||
if (トップ != e)
|
||||
{
|
||||
return ミドル == e;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public bool Contains(Ele e)
|
||||
{
|
||||
if (トップ != e)
|
||||
{
|
||||
return ミドル == e;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user