Changed class names to be more understandable. Separate some initializes from Character class to CharacterFluidSystem

This commit is contained in:
Absolutely disgusting
2026-03-14 13:00:40 +04:00
parent b781f689ac
commit fc88cf2a9c
656 changed files with 6604 additions and 6672 deletions

View File

@@ -0,0 +1,77 @@
using System;
namespace _2DGAMELIB
{
public class Motion : MotV
{
public Action<Motion> OnStart;
public Action<Motion> OnUpdate;
public Action<Motion> OnReach;
public Action<Motion> OnLoop;
public Action<Motion> OnEnd;
private bool run; //OnUpdate
private bool rou; //OnLoop
public bool Run => run;
public Motion(double Min, double Max)
: base(Min, Max)
{
}
public new void GetValue(FPS FPS)
{
if (!run)
{
return;
}
base.GetValue(FPS);
if (OnUpdate != null)
{
OnUpdate(this);
}
if (Value == min)
{
if (rou && OnLoop != null)
{
OnLoop(this);
}
rou = false;
}
else if (Value == max)
{
if (OnReach != null)
{
OnReach(this);
}
rou = true;
}
}
public void Start()
{
if (OnStart != null)
{
OnStart(this);
}
run = true;
}
public void End()
{
run = false;
if (OnEnd != null)
{
OnEnd(this);
}
ResetValue();
rou = false;
}
}
}