Renamed Par -> ShapePart

Renamed ParT -> ShapePartT
This commit is contained in:
2026-06-13 20:45:58 +02:00
parent e424ebc7e9
commit a588c1273b
366 changed files with 14546 additions and 14537 deletions

View File

@@ -50,9 +50,9 @@ namespace _2DGAMELIB
public Pars Pars => pars;
public But(ParT ParT, Action<But> Action)
public But(ShapePartT ShapePartT, Action<But> Action)
{
pars = new Pars(ParT);
pars = new Pars(ShapePartT);
this.Action = Action;
}
@@ -119,7 +119,7 @@ namespace _2DGAMELIB
public void SetHitColor(ModeEventDispatcher Med)
{
foreach (Par item in pars.EnumAllPar())
foreach (ShapePart item in pars.EnumAllPar())
{
if (item.HitColor != Color.Transparent)
{

View File

@@ -15,15 +15,15 @@ namespace _2DGAMELIB
public List<Color> TextColors = new List<Color>();
public But1(ParT ParT, Action<But> Action)
: base(ParT, Action)
public But1(ShapePartT ShapePartT, Action<But> Action)
: base(ShapePartT, Action)
{
Setting();
}
private void Setting()
{
foreach (Par item in pars.EnumAllPar())
foreach (ShapePart item in pars.EnumAllPar())
{
BaseColors.Add(item.BrushColor);
OverColors.Add(BaseColors.Last().FuncHSV(delegate(Hsv hsv)
@@ -45,7 +45,7 @@ namespace _2DGAMELIB
Over = delegate
{
int num4 = 0;
foreach (Par item2 in pars.EnumAllPar())
foreach (ShapePart item2 in pars.EnumAllPar())
{
item2.BrushColor = OverColors[num4];
if (item2.IsParT())
@@ -58,7 +58,7 @@ namespace _2DGAMELIB
Push = delegate
{
int num3 = 0;
foreach (Par item3 in pars.EnumAllPar())
foreach (ShapePart item3 in pars.EnumAllPar())
{
item3.BrushColor = PushColors[num3];
if (item3.IsParT())
@@ -71,7 +71,7 @@ namespace _2DGAMELIB
Release = delegate
{
int num2 = 0;
foreach (Par item4 in pars.EnumAllPar())
foreach (ShapePart item4 in pars.EnumAllPar())
{
item4.BrushColor = OverColors[num2];
if (item4.IsParT())
@@ -84,7 +84,7 @@ namespace _2DGAMELIB
Out = delegate
{
int num = 0;
foreach (Par item5 in pars.EnumAllPar())
foreach (ShapePart item5 in pars.EnumAllPar())
{
item5.BrushColor = BaseColors[num];
if (item5.IsParT())

View File

@@ -159,11 +159,11 @@ namespace _2DGAMELIB
}
}
public IEnumerable<Par> EnumAllPar()
public IEnumerable<ShapePart> EnumAllPar()
{
foreach (Pars item in parss)
{
foreach (Par item2 in item.EnumAllPar())
foreach (ShapePart item2 in item.EnumAllPar())
{
yield return item2;
}
@@ -211,9 +211,9 @@ namespace _2DGAMELIB
return list;
}
public List<Par> GetHitPars(ref Color HitColor)
public List<ShapePart> GetHitPars(ref Color HitColor)
{
List<Par> list = new List<Par>();
List<ShapePart> list = new List<ShapePart>();
foreach (Pars item in parss)
{
list.AddRange(item.GetHitPars(ref HitColor));

View File

@@ -19,7 +19,7 @@ namespace _2DGAMELIB
public Dictionary<Pars, Joints> pj;
public Dictionary<Pars, Par> pr;
public Dictionary<Pars, ShapePart> pr;
public int CountX => difs.Count;
@@ -214,7 +214,7 @@ namespace _2DGAMELIB
}
[JsonIgnore]
public Par CurJoinRoot
public ShapePart CurJoinRoot
{
get
{
@@ -228,12 +228,12 @@ namespace _2DGAMELIB
}
[JsonIgnore]
public IEnumerable<Par> EnumJoinRoot => pr.Values;
public IEnumerable<Par> EnumAllPar()
public IEnumerable<ShapePart> EnumJoinRoot => pr.Values;
public IEnumerable<ShapePart> EnumAllPar()
{
foreach (Dif dif in difs)
{
foreach (Par item in dif.EnumAllPar())
foreach (ShapePart item in dif.EnumAllPar())
{
yield return item;
}
@@ -294,26 +294,26 @@ namespace _2DGAMELIB
AreM.Draw(Current);
}
private Par GetJoinRoot(Pars ps)
private ShapePart GetJoinRoot(Pars ps)
{
Par[] array = ps.EnumAllPar().ToArray();
ShapePart[] array = ps.EnumAllPar().ToArray();
if (array.Length <= 1)
{
return array.FirstOrDefault();
}
Par[] array2 = array;
foreach (Par p0 in array2)
ShapePart[] array2 = array;
foreach (ShapePart 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))))
if (array.All((ShapePart 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)
ShapePart shapePart = array.FirstOrDefault((ShapePart e) => e.JP.Count > 0);
if (shapePart != null)
{
return par;
return shapePart;
}
return array.First();
}
@@ -321,10 +321,10 @@ namespace _2DGAMELIB
public void SetJoints()
{
pj = new Dictionary<Pars, Joints>();
pr = new Dictionary<Pars, Par>();
pr = new Dictionary<Pars, ShapePart>();
foreach (Pars item in EnumAllPars())
{
Par joinRoot = GetJoinRoot(item);
ShapePart joinRoot = GetJoinRoot(item);
if (joinRoot != null)
{
pj.Add(item, joinRoot.GetJoints(item.EnumAllPar()));
@@ -359,9 +359,9 @@ namespace _2DGAMELIB
}
}
public Par GetHitPar_(Color HitColor)
public ShapePart 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);
return difs.FirstOrDefault((Dif d) => d.IsHit(ref HitColor)).Parss.FirstOrDefault((Pars ps) => ps.IsHit(ref HitColor)).EnumAllPar().FirstOrDefault((ShapePart e) => e.HitColor == HitColor);
}
public bool IsHit(ref Color HitColor)

View File

@@ -20,15 +20,15 @@ namespace _2DGAMELIB
{
private Pars pars;
private Par base_;
private ShapePart base_;
private Par frame1;
private ShapePart frame1;
private Par frame2;
private ShapePart frame2;
private Par gauge;
private ShapePart gauge;
private Par knob;
private ShapePart knob;
private double val;
@@ -58,13 +58,13 @@ namespace _2DGAMELIB
public Pars Pars => pars;
public Par Base => base_;
public ShapePart Base => base_;
public Par Frame1 => frame1;
public ShapePart Frame1 => frame1;
public Par Gauge => gauge;
public ShapePart Gauge => gauge;
public Par Knob => knob;
public ShapePart Knob => knob;
public double Value
{
@@ -283,7 +283,7 @@ namespace _2DGAMELIB
private void ParSetting(string Name, ref Vector2D Position, double Size, double Width, double Height, double Margin, ref Color BackColor, bool knob)
{
pars = new Pars();
base_ = new Par
base_ = new ShapePart
{
Tag = Name + "_ベース",
InitializeOP = new Out[1] { Shas.GetSquare() },
@@ -297,7 +297,7 @@ namespace _2DGAMELIB
};
base_.BasePointBase = base_.OP.GetCenter();
pars.Add(base_.Tag, base_);
frame1 = new Par
frame1 = new ShapePart
{
Tag = Name + "_フレーム1",
InitializeOP = new Out[1] { Shas.GetSquare() },
@@ -312,7 +312,7 @@ namespace _2DGAMELIB
pars.Add(frame1.Tag, frame1);
if (Range == Range.MinusPlus)
{
frame2 = new Par
frame2 = new ShapePart
{
Tag = Name + "_フレーム2",
InitializeOP = new Out[1] { Shas.GetSquare() },
@@ -326,7 +326,7 @@ namespace _2DGAMELIB
frame2.BasePointBase = GetBasePoint2();
pars.Add(frame2.Tag, frame2);
}
gauge = new Par
gauge = new ShapePart
{
Tag = Name + "_ゲージ",
InitializeOP = new Out[1] { Shas.GetSquare() },
@@ -340,7 +340,7 @@ namespace _2DGAMELIB
pars.Add(gauge.Tag, gauge);
if (knob)
{
this.knob = new Par
this.knob = new ShapePart
{
Tag = Name + "_ブ",
InitializeOP = new Out[1] { Shas.GetSquare() },

View File

@@ -8,18 +8,18 @@ namespace _2DGAMELIB
{
public static double IdentityDistance = System.Math.Pow(5E-05, 2.0);
public static Joints GetJoints(this Par JoinRoot, IEnumerable<Par> EnumPar)
public static Joints GetJoints(this ShapePart JoinRoot, IEnumerable<ShapePart> EnumPar)
{
Joints joints = new Joints();
int num = 0;
List<int> list = new List<int>();
List<Par> list2 = EnumPar.ToList();
List<ShapePart> 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)
foreach (ShapePart item2 in list2)
{
if (JoinRoot != item2)
{
@@ -48,7 +48,7 @@ namespace _2DGAMELIB
return joints;
}
private static void GetJoints(List<Par> pl, Joints js, List<int> del)
private static void GetJoints(List<ShapePart> pl, Joints js, List<int> del)
{
int num = -1;
int num2 = 0;
@@ -57,20 +57,20 @@ namespace _2DGAMELIB
num = js.Joins.Count;
for (int i = num2; i < num; i++)
{
Par par = js.Joins[i].Par1;
ShapePart shapePart = js.Joins[i].Par1;
int num3 = 0;
foreach (Joi item in par.JP)
foreach (Joi item in shapePart.JP)
{
Vector2D v = par.ToGlobal(item.Joint);
Vector2D v = shapePart.ToGlobal(item.Joint);
int num4 = 0;
del.Clear();
foreach (Par item2 in pl)
foreach (ShapePart item2 in pl)
{
if (par != item2)
if (shapePart != item2)
{
if (v.DistanceSquared(item2.Position) <= IdentityDistance)
{
js.Joins.Add(new Joint(par, num3, item2));
js.Joins.Add(new Joint(shapePart, num3, item2));
if (!del.Contains(num4))
{
del.Add(num4);
@@ -99,7 +99,7 @@ namespace _2DGAMELIB
JointsD jointsD = new JointsD();
List<int> list = new List<int>();
List<Difs> list2 = EnumDifs.ToList();
foreach (Par item in JoinRoot.EnumAllPar())
foreach (ShapePart item in JoinRoot.EnumAllPar())
{
int num = 0;
list.Clear();
@@ -111,7 +111,7 @@ namespace _2DGAMELIB
foreach (Joi item3 in item.JP)
{
Vector2D v = item.ToGlobal(item3.Joint);
foreach (Par item4 in item2.EnumJoinRoot)
foreach (ShapePart item4 in item2.EnumJoinRoot)
{
if (v.DistanceSquared(item4.Position) <= IdentityDistance)
{
@@ -151,7 +151,7 @@ namespace _2DGAMELIB
for (int i = num2; i < num; i++)
{
Difs difs = jsd.Joins[i].Difs1;
foreach (Par item in difs.EnumAllPar())
foreach (ShapePart item in difs.EnumAllPar())
{
int num3 = 0;
del.Clear();
@@ -163,7 +163,7 @@ namespace _2DGAMELIB
foreach (Joi item3 in item.JP)
{
Vector2D v = item.ToGlobal(item3.Joint);
foreach (Par item4 in item2.EnumJoinRoot)
foreach (ShapePart item4 in item2.EnumJoinRoot)
{
if (v.DistanceSquared(item4.Position) <= IdentityDistance)
{

View File

@@ -5,13 +5,13 @@ namespace _2DGAMELIB
[Serializable]
public class Joint
{
public Par Par0;
public ShapePart Par0;
public int Index;
public Par Par1;
public ShapePart Par1;
public Joint(Par Par0, int Index, Par Par1)
public Joint(ShapePart Par0, int Index, ShapePart Par1)
{
this.Par0 = Par0;
this.Index = Index;

View File

@@ -14,7 +14,7 @@ namespace _2DGAMELIB
public Difs Difs1;
public JointD(Difs Difs0, Par Par0, int Index, Difs Difs1)
public JointD(Difs Difs0, ShapePart Par0, int Index, Difs Difs1)
{
this.Difs0 = Difs0;
Path0 = Par0.GetPath();

View File

@@ -33,10 +33,10 @@ namespace _2DGAMELIB
public int Index;
public JointS(Difs Difs, Par Par, int Index)
public JointS(Difs Difs, ShapePart ShapePart, int Index)
{
this.Difs = Difs;
Path = Par.GetPath();
Path = ShapePart.GetPath();
this.Index = Index;
}
}

View File

@@ -5,7 +5,7 @@ namespace _2DGAMELIB
{
public class Lab
{
private ParT parT;
private ShapePartT _shapePartT;
private RenderArea Are;
@@ -13,13 +13,13 @@ namespace _2DGAMELIB
private double Min;
public ParT ParT => parT;
public ShapePartT ShapePartT => _shapePartT;
public string Text
{
get
{
return parT.Text;
return _shapePartT.Text;
}
set
{
@@ -29,7 +29,7 @@ namespace _2DGAMELIB
private void SetText(string Text)
{
parT.Text = Text;
_shapePartT.Text = Text;
SetRect();
}
@@ -55,7 +55,7 @@ namespace _2DGAMELIB
}
parT = new ParT
_shapePartT = new ShapePartT
{
InitializeOP = array,
BasePointBase = array[0].ps[0],
@@ -75,49 +75,49 @@ namespace _2DGAMELIB
if (ShadColor != Color.Empty)
{
parT.ShadBrush = new SolidBrush(ShadColor);
_shapePartT.ShadBrush = new SolidBrush(ShadColor);
}
SetRect();
Min = parT.RectSize.Y;
Min = _shapePartT.RectSize.Y;
SetText(Text);
}
public void SetHitColor(ModeEventDispatcher Med)
{
if (parT.HitColor != Color.Transparent)
if (_shapePartT.HitColor != Color.Transparent)
{
Med.RemUniqueColor(parT.HitColor);
Med.RemUniqueColor(_shapePartT.HitColor);
}
parT.HitColor = Med.GetUniqueColor();
_shapePartT.HitColor = Med.GetUniqueColor();
}
private void SetRect()
{
if (!string.IsNullOrEmpty(parT.Text))
if (!string.IsNullOrEmpty(_shapePartT.Text))
{
parT.RectSize = new Vector2D(Width, 10.0);
Vector2D_2 stringRect = parT.GetStringRect(Are.DisplayUnitScale, Are.DisplayGraphics);
_shapePartT.RectSize = new Vector2D(Width, 10.0);
Vector2D_2 stringRect = _shapePartT.GetStringRect(Are.DisplayUnitScale, Are.DisplayGraphics);
double x = ((stringRect.v2.X > Min) ? stringRect.v2.X : Min) + 0.07;
parT.RectSize = new Vector2D(x, stringRect.v2.Y);
_shapePartT.RectSize = new Vector2D(x, stringRect.v2.Y);
}
else
{
double x2 = Min + 0.07;
parT.RectSize = new Vector2D(x2, Min);
_shapePartT.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);
_shapePartT.OP[0].ps[0] = new Vector2D(0.0, 0.0);
_shapePartT.OP[0].ps[1] = new Vector2D(_shapePartT.RectSize.X, 0.0);
_shapePartT.OP[0].ps[2] = new Vector2D(_shapePartT.RectSize.X, _shapePartT.RectSize.Y);
_shapePartT.OP[0].ps[3] = new Vector2D(0.0, _shapePartT.RectSize.Y);
}
public void Dispose()
{
parT.Dispose();
_shapePartT.Dispose();
}
}
}

View File

@@ -28,7 +28,7 @@ namespace _2DGAMELIB
{
foreach (Lab value in labs.Values)
{
Are.Draw(value.ParT);
Are.Draw(value.ShapePartT);
}
}

View File

@@ -366,9 +366,9 @@ namespace _2DGAMELIB
HitColors.Add(c);
}
public void SetUniqueColor(IEnumerable<Par> ps)
public void SetUniqueColor(IEnumerable<ShapePart> ps)
{
foreach (Par p in ps)
foreach (ShapePart p in ps)
{
p.HitColor = GetUniqueColor();
}
@@ -379,9 +379,9 @@ namespace _2DGAMELIB
HitColors.Remove(Color);
}
public void RemUniqueColor(IEnumerable<Par> ps)
public void RemUniqueColor(IEnumerable<ShapePart> ps)
{
foreach (Par p in ps)
foreach (ShapePart p in ps)
{
HitColors.Remove(p.HitColor);
}

View File

@@ -178,11 +178,11 @@ namespace _2DGAMELIB
}
public Difs JoinRoot => r;
public IEnumerable<Par> EnumAllPar()
public IEnumerable<ShapePart> EnumAllPar()
{
foreach (Difs value in Difss.Values)
{
foreach (Par item in value.EnumAllPar())
foreach (ShapePart item in value.EnumAllPar())
{
yield return item;
}
@@ -220,15 +220,15 @@ namespace _2DGAMELIB
{
return array.FirstOrDefault();
}
Par[] pa = EnumAllPar().ToArray();
ShapePart[] pa = EnumAllPar().ToArray();
Difs[] array2 = array;
Vector2D p;
foreach (Difs difs in array2)
{
if (difs.EnumJoinRoot.All(delegate(Par p0)
if (difs.EnumJoinRoot.All(delegate(ShapePart p0)
{
p = p0.Position;
return pa.All((Par p1) => p0 == p1 || p1.JP.All((Joi j) => !(p1.ToGlobal(j.Joint).DistanceSquared(p) <= Join.IdentityDistance)));
return pa.All((ShapePart p1) => p0 == p1 || p1.JP.All((Joi j) => !(p1.ToGlobal(j.Joint).DistanceSquared(p) <= Join.IdentityDistance)));
}))
{
return difs;

View File

@@ -64,13 +64,13 @@ namespace _2DGAMELIB
};
}
private static void GetMinMaxX(Par Par, ref double MinX, ref double MaxX)
private static void GetMinMaxX(ShapePart ShapePart, ref double MinX, ref double MaxX)
{
foreach (Out item in Par.OP)
foreach (Out item in ShapePart.OP)
{
foreach (Vector2D p in item.ps)
{
Vector2D vector2D = Par.ToGlobal(p);
Vector2D vector2D = ShapePart.ToGlobal(p);
if (MinX > vector2D.X)
{
MinX = vector2D.X;
@@ -83,13 +83,13 @@ namespace _2DGAMELIB
}
}
private static void GetMinMaxY(Par Par, ref double MinY, ref double MaxY)
private static void GetMinMaxY(ShapePart ShapePart, ref double MinY, ref double MaxY)
{
foreach (Out item in Par.OP)
foreach (Out item in ShapePart.OP)
{
foreach (Vector2D p in item.ps)
{
Vector2D vector2D = Par.ToGlobal(p);
Vector2D vector2D = ShapePart.ToGlobal(p);
if (MinY > vector2D.Y)
{
MinY = vector2D.Y;
@@ -102,7 +102,7 @@ namespace _2DGAMELIB
}
}
private static void GetMinMaxY(Par[] Pars, ref double MinY, ref double MaxY)
private static void GetMinMaxY(ShapePart[] Pars, ref double MinY, ref double MaxY)
{
for (int i = 0; i < Pars.Length; i++)
{
@@ -110,50 +110,50 @@ namespace _2DGAMELIB
}
}
public static void GetMiX_MaX(this Par Par, out Vector2D[] MM)
public static void GetMiX_MaX(this ShapePart ShapePart, out Vector2D[] MM)
{
Vector2D vector2D = Par.ToGlobal(Par.OP.First().ps.First());
Vector2D vector2D = ShapePart.ToGlobal(ShapePart.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);
GetMinMaxX(ShapePart, ref MM[0].X, ref MM[1].X);
}
public static void GetMaX_MiX(this Par Par, out Vector2D[] MM)
public static void GetMaX_MiX(this ShapePart ShapePart, out Vector2D[] MM)
{
Vector2D vector2D = Par.ToGlobal(Par.OP.First().ps.First());
Vector2D vector2D = ShapePart.ToGlobal(ShapePart.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);
GetMinMaxX(ShapePart, ref MM[1].X, ref MM[0].X);
}
public static void GetMiY_MaY(this Par Par, out Vector2D[] MM)
public static void GetMiY_MaY(this ShapePart ShapePart, out Vector2D[] MM)
{
Vector2D vector2D = Par.ToGlobal(Par.OP.First().ps.First());
Vector2D vector2D = ShapePart.ToGlobal(ShapePart.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);
GetMinMaxY(ShapePart, ref MM[0].Y, ref MM[1].Y);
}
public static void GetMiY_MaY(this Par[] Pars, out Vector2D[] MM)
public static void GetMiY_MaY(this ShapePart[] Pars, out Vector2D[] MM)
{
Par par = Pars.First();
Vector2D vector2D = par.ToGlobal(par.OP.First().ps.First());
ShapePart shapePart = Pars.First();
Vector2D vector2D = shapePart.ToGlobal(shapePart.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)
public static void GetMaY_MiY(this ShapePart ShapePart, out Vector2D[] MM)
{
Vector2D vector2D = Par.ToGlobal(Par.OP.First().ps.First());
Vector2D vector2D = ShapePart.ToGlobal(ShapePart.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);
GetMinMaxY(ShapePart, ref MM[1].Y, ref MM[0].Y);
}
public static Obj ObjLoad(this byte[] bd)

View File

@@ -30,9 +30,9 @@ namespace _2DGAMELIB
{
((Pars)value2).PositionSize = value;
}
else if (value2 is Par)
else if (value2 is ShapePart)
{
((Par)value2).PositionSize = value;
((ShapePart)value2).PositionSize = value;
}
}
}
@@ -48,9 +48,9 @@ namespace _2DGAMELIB
{
((Pars)value2).PositionVector = value;
}
else if (value2 is Par)
else if (value2 is ShapePart)
{
((Par)value2).PositionVector = value;
((ShapePart)value2).PositionVector = value;
}
}
}
@@ -66,9 +66,9 @@ namespace _2DGAMELIB
{
((Pars)value2).AngleBase = value;
}
else if (value2 is Par)
else if (value2 is ShapePart)
{
((Par)value2).AngleBase = value;
((ShapePart)value2).AngleBase = value;
}
}
}
@@ -84,9 +84,9 @@ namespace _2DGAMELIB
{
((Pars)value2).AngleCont = value;
}
else if (value2 is Par)
else if (value2 is ShapePart)
{
((Par)value2).AngleCont = value;
((ShapePart)value2).AngleCont = value;
}
}
}
@@ -102,9 +102,9 @@ namespace _2DGAMELIB
{
((Pars)value2).SizeBase = value;
}
else if (value2 is Par)
else if (value2 is ShapePart)
{
((Par)value2).SizeBase = value;
((ShapePart)value2).SizeBase = value;
}
}
}
@@ -120,9 +120,9 @@ namespace _2DGAMELIB
{
((Pars)value2).SizeCont = value;
}
else if (value2 is Par)
else if (value2 is ShapePart)
{
((Par)value2).SizeCont = value;
((ShapePart)value2).SizeCont = value;
}
}
}
@@ -138,9 +138,9 @@ namespace _2DGAMELIB
{
((Pars)value2).SizeXBase = value;
}
else if (value2 is Par)
else if (value2 is ShapePart)
{
((Par)value2).SizeXBase = value;
((ShapePart)value2).SizeXBase = value;
}
}
}
@@ -156,9 +156,9 @@ namespace _2DGAMELIB
{
((Pars)value2).SizeXCont = value;
}
else if (value2 is Par)
else if (value2 is ShapePart)
{
((Par)value2).SizeXCont = value;
((ShapePart)value2).SizeXCont = value;
}
}
}
@@ -174,9 +174,9 @@ namespace _2DGAMELIB
{
((Pars)value2).SizeYBase = value;
}
else if (value2 is Par)
else if (value2 is ShapePart)
{
((Par)value2).SizeYBase = value;
((ShapePart)value2).SizeYBase = value;
}
}
}
@@ -192,9 +192,9 @@ namespace _2DGAMELIB
{
((Pars)value2).SizeYCont = value;
}
else if (value2 is Par)
else if (value2 is ShapePart)
{
((Par)value2).SizeYCont = value;
((ShapePart)value2).SizeYCont = value;
}
}
}
@@ -210,9 +210,9 @@ namespace _2DGAMELIB
{
((Pars)value2).Dra = value;
}
else if (value2 is Par)
else if (value2 is ShapePart)
{
((Par)value2).Dra = value;
((ShapePart)value2).Dra = value;
}
}
}
@@ -228,9 +228,9 @@ namespace _2DGAMELIB
{
((Pars)value2).Hit = value;
}
else if (value2 is Par)
else if (value2 is ShapePart)
{
((Par)value2).Hit = value;
((ShapePart)value2).Hit = value;
}
}
}
@@ -270,16 +270,16 @@ namespace _2DGAMELIB
return pars.IndexOf(obj);
}
public void Add(string Name, Par Par)
public void Add(string Name, ShapePart ShapePart)
{
Par.SetParent(this);
pars.Add(Name, Par);
ShapePart.SetParent(this);
pars.Add(Name, ShapePart);
}
public void Add(string Name, ParT ParT)
public void Add(string Name, ShapePartT ShapePartT)
{
ParT.SetParent(this);
pars.Add(Name, ParT);
ShapePartT.SetParent(this);
pars.Add(Name, ShapePartT);
}
public void Add(string Name, Pars Pars)
@@ -301,31 +301,31 @@ namespace _2DGAMELIB
{
((Pars)obj).SetParent(null);
}
else if (obj is ParT)
else if (obj is ShapePartT)
{
((ParT)obj).SetParent(null);
((ShapePartT)obj).SetParent(null);
}
else if (obj is Par)
else if (obj is ShapePart)
{
((Par)obj).SetParent(null);
((ShapePart)obj).SetParent(null);
}
pars.Remove(Name);
}
public IEnumerable<Par> EnumAllPar()
public IEnumerable<ShapePart> EnumAllPar()
{
foreach (object value in pars.Values)
{
if (value is Pars)
{
foreach (Par item in ((Pars)value).EnumAllPar())
foreach (ShapePart item in ((Pars)value).EnumAllPar())
{
yield return item;
}
}
else if (value is Par)
else if (value is ShapePart)
{
yield return (Par)value;
yield return (ShapePart)value;
}
}
}
@@ -338,13 +338,13 @@ namespace _2DGAMELIB
{
((Pars)value).SetDefault();
}
else if (value is ParT)
else if (value is ShapePartT)
{
((ParT)value).SetDefault();
((ShapePartT)value).SetDefault();
}
else if (value is Par)
else if (value is ShapePart)
{
((Par)value).SetDefault();
((ShapePart)value).SetDefault();
}
}
}
@@ -353,16 +353,16 @@ namespace _2DGAMELIB
{
}
public Pars(Par Par)
public Pars(ShapePart ShapePart)
{
Tag = Par.Tag;
Add(Par.Tag, Par);
Tag = ShapePart.Tag;
Add(ShapePart.Tag, ShapePart);
}
public Pars(ParT ParT)
public Pars(ShapePartT ShapePartT)
{
Tag = ParT.Tag;
Add(ParT.Tag, ParT);
Tag = ShapePartT.Tag;
Add(ShapePartT.Tag, ShapePartT);
}
public Pars(Pars Pars)
@@ -380,13 +380,13 @@ namespace _2DGAMELIB
{
Add(key, ((Pars)obj).Clone());
}
else if (obj is ParT)
else if (obj is ShapePartT)
{
Add(key, new ParT((ParT)obj));
Add(key, new ShapePartT((ShapePartT)obj));
}
else if (obj is Par)
else if (obj is ShapePart)
{
Add(key, new Par((Par)obj));
Add(key, new ShapePart((ShapePart)obj));
}
}
}
@@ -402,13 +402,13 @@ namespace _2DGAMELIB
{
pars2.Add(key, ((Pars)obj).Clone());
}
else if (obj is ParT)
else if (obj is ShapePartT)
{
pars2.Add(key, new ParT((ParT)obj));
pars2.Add(key, new ShapePartT((ShapePartT)obj));
}
else if (obj is Par)
else if (obj is ShapePart)
{
pars2.Add(key, new Par((Par)obj));
pars2.Add(key, new ShapePart((ShapePart)obj));
}
}
return pars2;
@@ -422,13 +422,13 @@ namespace _2DGAMELIB
{
((Pars)value).Draw(Unit, Graphics);
}
else if (value is ParT)
else if (value is ShapePartT)
{
((ParT)value).Draw(Unit, Graphics);
((ShapePartT)value).Draw(Unit, Graphics);
}
else if (value is Par)
else if (value is ShapePart)
{
((Par)value).Draw(Unit, Graphics);
((ShapePart)value).Draw(Unit, Graphics);
}
}
}
@@ -441,9 +441,9 @@ namespace _2DGAMELIB
{
((Pars)value).DrawH(Unit, Graphics);
}
else if (value is Par)
else if (value is ShapePart)
{
((Par)value).DrawH(Unit, Graphics);
((ShapePart)value).DrawH(Unit, Graphics);
}
}
}
@@ -453,30 +453,30 @@ namespace _2DGAMELIB
List<string> list = new List<string>();
foreach (object value in pars.Values)
{
Par par;
ShapePart shapePart;
if (value is Pars)
{
list.AddRange(((Pars)value).GetHitTags(ref HitColor));
}
else if (value is Par && (par = (Par)value).HitColor == HitColor)
else if (value is ShapePart && (shapePart = (ShapePart)value).HitColor == HitColor)
{
list.Add(par.Tag);
list.Add(shapePart.Tag);
}
}
return list;
}
public List<Par> GetHitPars(ref Color HitColor)
public List<ShapePart> GetHitPars(ref Color HitColor)
{
List<Par> list = new List<Par>();
List<ShapePart> list = new List<ShapePart>();
foreach (object value in pars.Values)
{
Par item;
ShapePart item;
if (value is Pars)
{
list.AddRange(((Pars)value).GetHitPars(ref HitColor));
}
else if (value is Par && (item = (Par)value).HitColor == HitColor)
else if (value is ShapePart && (item = (ShapePart)value).HitColor == HitColor)
{
list.Add(item);
}
@@ -492,7 +492,7 @@ namespace _2DGAMELIB
{
return true;
}
if (value is Par && ((Par)value).HitColor == HitColor)
if (value is ShapePart && ((ShapePart)value).HitColor == HitColor)
{
return true;
}
@@ -500,19 +500,19 @@ namespace _2DGAMELIB
return false;
}
public Par GetPar(List<int> Path)
public ShapePart GetPar(List<int> Path)
{
return GetPar(0, Path);
}
private Par GetPar(int l, List<int> Path)
private ShapePart GetPar(int l, List<int> Path)
{
object obj = pars[Path[l]];
if (obj is Pars)
{
return ((Pars)obj).GetPar(l + 1, Path);
}
return (Par)obj;
return (ShapePart)obj;
}
public void ReverseX()
@@ -523,9 +523,9 @@ namespace _2DGAMELIB
{
((Pars)value).ReverseX();
}
else if (value is Par)
else if (value is ShapePart)
{
((Par)value).ReverseX();
((ShapePart)value).ReverseX();
}
}
}
@@ -538,9 +538,9 @@ namespace _2DGAMELIB
{
((Pars)value).ReverseY();
}
else if (value is Par)
else if (value is ShapePart)
{
((Par)value).ReverseY();
((ShapePart)value).ReverseY();
}
}
}
@@ -553,13 +553,13 @@ namespace _2DGAMELIB
{
((Pars)value).Dispose();
}
else if (value is ParT)
else if (value is ShapePartT)
{
((ParT)value).Dispose();
((ShapePartT)value).Dispose();
}
else if (value is Par)
else if (value is ShapePart)
{
((Par)value).Dispose();
((ShapePart)value).Dispose();
}
}
}
@@ -571,14 +571,14 @@ namespace _2DGAMELIB
return (Pars)obj;
}
public static ParT ToParT(this object obj)
public static ShapePartT ToParT(this object obj)
{
return (ParT)obj;
return (ShapePartT)obj;
}
public static Par ToPar(this object obj)
public static ShapePart ToPar(this object obj)
{
return (Par)obj;
return (ShapePart)obj;
}
public static Pen Copy(this Pen Pen)

View File

@@ -92,21 +92,21 @@ namespace _2DGAMELIB
return new Vector2D(Position.X - BasePoint.X * XRatio * Size, Position.Y - BasePoint.Y * YRatio * Size);
}
public void Draw(Par Par)
public void Draw(ShapePart ShapePart)
{
Par.Draw(displayUnitScale, displayGraphics);
ShapePart.Draw(displayUnitScale, displayGraphics);
if (hitGraphics != null)
{
Par.DrawH(hitUnitScale, hitGraphics);
ShapePart.DrawH(hitUnitScale, hitGraphics);
}
}
public void Draw(ParT ParT)
public void Draw(ShapePartT ShapePartT)
{
ParT.Draw(displayUnitScale, displayGraphics);
ShapePartT.Draw(displayUnitScale, displayGraphics);
if (hitGraphics != null)
{
ParT.DrawH(hitUnitScale, hitGraphics);
ShapePartT.DrawH(hitUnitScale, hitGraphics);
}
}

View File

@@ -14,6 +14,15 @@ namespace _2DGAMELIB
{
private static SerializableAttribute s = new SerializableAttribute();
private static readonly RemappedTypeBinder Binder = new RemappedTypeBinder()
.Add("_2DGAMELIB.Par", typeof(ShapePart))
.Add("_2DGAMELIB.ParT", typeof(ShapePartT));
private static BinaryFormatter NewFormatter()
{
return new BinaryFormatter { Binder = Binder };
}
private static JsonSerializerSettings CreateSettings()
{
var settings = new JsonSerializerSettings
@@ -32,7 +41,7 @@ namespace _2DGAMELIB
public static T DeepCopy<T>(this T Object)
{
BinaryFormatter binaryFormatter = new BinaryFormatter();
BinaryFormatter binaryFormatter = NewFormatter();
using MemoryStream memoryStream = new MemoryStream();
binaryFormatter.Serialize(memoryStream, Object);
memoryStream.Position = 0L;
@@ -42,32 +51,32 @@ namespace _2DGAMELIB
public static byte[] ToSerialBytes<T>(this T Object)
{
using MemoryStream memoryStream = new MemoryStream();
new BinaryFormatter().Serialize(memoryStream, Object);
NewFormatter().Serialize(memoryStream, Object);
return memoryStream.ToArray();
}
public static T ToDeserialObject<T>(this byte[] Bytes)
{
using MemoryStream serializationStream = new MemoryStream(Bytes);
return (T)new BinaryFormatter().Deserialize(serializationStream);
return (T)NewFormatter().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);
NewFormatter().Serialize(serializationStream, 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);
return (T)NewFormatter().Deserialize(serializationStream);
}
public static T Load<T>(this byte[] bd)
{
using MemoryStream serializationStream = new MemoryStream(bd);
return (T)new BinaryFormatter().Deserialize(serializationStream);
return (T)NewFormatter().Deserialize(serializationStream);
}
static Ser() { }

View File

@@ -10,7 +10,7 @@ namespace _2DGAMELIB
{
//represents a whole or part of a body part :3
[Serializable]
public class Par
public class ShapePart
{
//FOR TESTS
public static long TCalc;
@@ -569,61 +569,61 @@ namespace _2DGAMELIB
gph = new GraphicsPath();
}
public Par()
public ShapePart()
{
pen.StartCap = LineCap.Round;
pen.EndCap = LineCap.Round;
}
public Par(Par Par)
public ShapePart(ShapePart ShapePart)
{
Copy(Par);
Copy(ShapePart);
}
protected void Copy(Par Par)
protected void Copy(ShapePart ShapePart)
{
Tag = Par.Tag;
op = new List<Out>(Par.op.Count);
for (int i = 0; i < Par.op.Count; i++)
Tag = ShapePart.Tag;
op = new List<Out>(ShapePart.op.Count);
for (int i = 0; i < ShapePart.op.Count; i++)
{
op.Add(new Out(Par.op[i]));
op.Add(new Out(ShapePart.op[i]));
}
jp = new List<Joi>(Par.jp.Count);
for (int j = 0; j < Par.jp.Count; j++)
jp = new List<Joi>(ShapePart.jp.Count);
for (int j = 0; j < ShapePart.jp.Count; j++)
{
jp.Add(new Joi(Par.jp[j]));
jp.Add(new Joi(ShapePart.jp[j]));
}
basePointBase = Par.basePointBase;
basePointCont = Par.basePointCont;
positionBase = Par.positionBase;
positionContO = Par.positionContO;
positionCont = Par.positionCont;
positionSize = Par.positionSize;
positionVector = Par.positionVector;
anglePare = Par.anglePare;
angleBase = Par.angleBase;
angleCont = Par.angleCont;
sizeBase = Par.sizeBase;
sizeCont = Par.sizeCont;
xSizeBase = Par.xSizeBase;
xSizeCont = Par.xSizeCont;
ySizeBase = Par.ySizeBase;
ySizeCont = Par.ySizeCont;
penWidth = Par.penWidth;
Dra = Par.Dra;
closed = Par.closed;
if (Par.pen != null)
basePointBase = ShapePart.basePointBase;
basePointCont = ShapePart.basePointCont;
positionBase = ShapePart.positionBase;
positionContO = ShapePart.positionContO;
positionCont = ShapePart.positionCont;
positionSize = ShapePart.positionSize;
positionVector = ShapePart.positionVector;
anglePare = ShapePart.anglePare;
angleBase = ShapePart.angleBase;
angleCont = ShapePart.angleCont;
sizeBase = ShapePart.sizeBase;
sizeCont = ShapePart.sizeCont;
xSizeBase = ShapePart.xSizeBase;
xSizeCont = ShapePart.xSizeCont;
ySizeBase = ShapePart.ySizeBase;
ySizeCont = ShapePart.ySizeCont;
penWidth = ShapePart.penWidth;
Dra = ShapePart.Dra;
closed = ShapePart.closed;
if (ShapePart.pen != null)
{
Pen = Par.pen.Copy();
Pen = ShapePart.pen.Copy();
}
if (Par.brush != null)
if (ShapePart.brush != null)
{
Brush = Par.brush.Copy();
Brush = ShapePart.brush.Copy();
}
Hit = Par.Hit;
if (Par.HitBrush != null)
Hit = ShapePart.Hit;
if (ShapePart.HitBrush != null)
{
HitBrush = (SolidBrush)Par.HitBrush.Copy();
HitBrush = (SolidBrush)ShapePart.HitBrush.Copy();
}
}
@@ -833,25 +833,25 @@ namespace _2DGAMELIB
}
}
public void SetJointP(int Index, Par Par)
public void SetJointP(int Index, ShapePart ShapePart)
{
if (Index < jp.Count)
{
Par.PositionBase = ToGlobal(jp[Index].Joint);
ShapePart.PositionBase = ToGlobal(jp[Index].Joint);
}
Par.Edit = true;
Par.EditH = true;
ShapePart.Edit = true;
ShapePart.EditH = true;
}
public void SetJointPA(int Index, Par Par)
public void SetJointPA(int Index, ShapePart ShapePart)
{
if (Index < jp.Count)
{
Par.PositionBase = ToGlobal(jp[Index].Joint);
ShapePart.PositionBase = ToGlobal(jp[Index].Joint);
}
Par.AngleParent = Angle;
Par.Edit = true;
Par.EditH = true;
ShapePart.AngleParent = Angle;
ShapePart.Edit = true;
ShapePart.EditH = true;
}
public Vector2D ToGlobal(Vector2D Local)
@@ -954,12 +954,12 @@ namespace _2DGAMELIB
public bool IsParT()
{
return this is ParT;
return this is ShapePartT;
}
public ParT ToParT()
public ShapePartT ToParT()
{
return (ParT)this;
return (ShapePartT)this;
}
public List<int> GetPath()

View File

@@ -7,7 +7,7 @@ namespace _2DGAMELIB
{
// renders text
[Serializable]
public class ParT : Par
public class ShapePartT : ShapePart
{
[NonSerialized, JsonIgnore]
private Font font = new Font("", 1f);
@@ -178,36 +178,36 @@ namespace _2DGAMELIB
EditTS = true;
}
public ParT()
public ShapePartT()
{
}
public ParT(ParT ParT)
public ShapePartT(ShapePartT ShapePartT)
{
CopyT(ParT);
CopyT(ShapePartT);
}
private void CopyT(ParT ParT)
private void CopyT(ShapePartT ShapePartT)
{
Copy(ParT);
Copy(ShapePartT);
fontSize = ParT.fontSize;
fontSize = ShapePartT.fontSize;
if (ParT.font != null)
Font = ParT.font.Copy();
if (ShapePartT.font != null)
Font = ShapePartT.font.Copy();
if (ParT.brusht != null)
TextBrush = ParT.brusht.Copy();
if (ShapePartT.brusht != null)
TextBrush = ShapePartT.brusht.Copy();
if (ParT.brushs != null)
ShadBrush = ParT.brushs.Copy();
if (ShapePartT.brushs != null)
ShadBrush = ShapePartT.brushs.Copy();
if (ParT.stringformat != null)
StringFormat = ParT.stringformat.Copy();
if (ShapePartT.stringformat != null)
StringFormat = ShapePartT.stringformat.Copy();
positionT = ParT.positionT;
rectSize = ParT.rectSize;
Text = ParT.Text;
positionT = ShapePartT.positionT;
rectSize = ShapePartT.rectSize;
Text = ShapePartT.Text;
}
public new void Draw(double Unit, Graphics Graphics)

View File

@@ -49,7 +49,7 @@ namespace _2DGAMELIB
}
i = 0;
{
foreach (Par item in but.Pars.EnumAllPar())
foreach (ShapePart item in but.Pars.EnumAllPar())
{
item.BrushColor = but.OverColors[i];
i++;
@@ -82,7 +82,7 @@ namespace _2DGAMELIB
});
}
j = 0;
foreach (Par item2 in but.Pars.EnumAllPar())
foreach (ShapePart item2 in but.Pars.EnumAllPar())
{
item2.BrushColor = but.OverColors[j];
j++;
@@ -120,7 +120,7 @@ namespace _2DGAMELIB
}
i = 0;
{
foreach (Par item in but.Pars.EnumAllPar())
foreach (ShapePart item in but.Pars.EnumAllPar())
{
item.BrushColor = but.BaseColors[i];
i++;
@@ -153,7 +153,7 @@ namespace _2DGAMELIB
});
}
j = 0;
foreach (Par item2 in but.Pars.EnumAllPar())
foreach (ShapePart item2 in but.Pars.EnumAllPar())
{
item2.BrushColor = but.BaseColors[j];
j++;

View File

@@ -9,9 +9,9 @@ namespace _2DGAMELIB
{
private Pars pars;
private ParT parT;
private ShapePartT _shapePartT;
private Par feed;
private ShapePart feed;
public int Space;
@@ -45,9 +45,9 @@ namespace _2DGAMELIB
public Pars Pars => pars;
public ParT ParT => parT;
public ShapePartT ShapePartT => _shapePartT;
public Par Feed => feed;
public ShapePart Feed => feed;
public string TextIm
{
@@ -68,9 +68,9 @@ namespace _2DGAMELIB
Max = text.Length;
Count = Max;
f1 = false;
if (parT != null)
if (_shapePartT != null)
{
parT.Text = text;
_shapePartT.Text = text;
}
}
}
@@ -113,14 +113,14 @@ namespace _2DGAMELIB
{
get
{
return parT.PositionBase;
return _shapePartT.PositionBase;
}
set
{
parT.PositionBase = value;
_shapePartT.PositionBase = value;
if (feed != null)
{
feed.PositionBase = parT.ToGlobal(parT.OP[0].ps[2] * 0.95);
feed.PositionBase = _shapePartT.ToGlobal(_shapePartT.OP[0].ps[2] * 0.95);
}
}
}
@@ -206,7 +206,7 @@ namespace _2DGAMELIB
pars = new Pars();
Out[] array = new Out[1] { Shas.GetSquare() };
array.OutlineFalse();
parT = new ParT
_shapePartT = new ShapePartT
{
Tag = Name,
InitializeOP = array,
@@ -220,24 +220,24 @@ namespace _2DGAMELIB
RectSize = new Vector2D(Width, Height),
Text = Text
};
ParT.OP.ScalingX(ParT.BasePointBase, Width);
ParT.OP.ScalingY(ParT.BasePointBase, Height);
ShapePartT.OP.ScalingX(ShapePartT.BasePointBase, Width);
ShapePartT.OP.ScalingY(ShapePartT.BasePointBase, Height);
if (ShadColor != Color.Empty)
{
parT.ShadBrush = new SolidBrush(ShadColor);
_shapePartT.ShadBrush = new SolidBrush(ShadColor);
}
pars.Add(parT.Tag, parT);
pars.Add(_shapePartT.Tag, _shapePartT);
}
private void SetFeed(string Name, double Size, ref Color FeedColor)
{
Out[] array = new Out[1] { Shas.GetTriangle() };
feed = new Par
feed = new ShapePart
{
Tag = Name + "_Feed",
InitializeOP = array,
BasePointBase = array.GetCenter(),
PositionBase = parT.ToGlobal(parT.OP[0].ps[2] * 0.96),
PositionBase = _shapePartT.ToGlobal(_shapePartT.OP[0].ps[2] * 0.96),
SizeBase = Size * 0.07,
SizeYBase = 0.9,
Closed = true,
@@ -251,11 +251,11 @@ namespace _2DGAMELIB
public void SetHitColor(ModeEventDispatcher Med)
{
if (parT.HitColor != Color.Transparent)
if (_shapePartT.HitColor != Color.Transparent)
{
Med.RemUniqueColor(parT.HitColor);
Med.RemUniqueColor(_shapePartT.HitColor);
}
parT.HitColor = Med.GetUniqueColor();
_shapePartT.HitColor = Med.GetUniqueColor();
}
public void Progression(FPS FPS)
@@ -266,10 +266,10 @@ namespace _2DGAMELIB
int num = (int)Count;
if (num <= Max)
{
parT.Text = text.Substring(0, num);
_shapePartT.Text = text.Substring(0, num);
return;
}
parT.Text = text;
_shapePartT.Text = text;
f1 = true;
if (feed != null)
{
@@ -292,7 +292,7 @@ namespace _2DGAMELIB
public bool Down(ref Color HitColor)
{
if (parT.HitColor == HitColor)
if (_shapePartT.HitColor == HitColor)
{
f2 = true;
if (!f1 && Speed == speed)
@@ -306,7 +306,7 @@ namespace _2DGAMELIB
public bool Up(ref Color HitColor)
{
if (f1 && f2 && parT.HitColor == HitColor && Speed == speed)
if (f1 && f2 && _shapePartT.HitColor == HitColor && Speed == speed)
{
f1 = false;
f2 = false;