port from perforce

This commit is contained in:
2026-04-18 22:31:51 +02:00
commit 8d0ab5b7cc
8409 changed files with 3972376 additions and 0 deletions

View File

@@ -0,0 +1,78 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Collections.ObjectModel;
namespace AiwazAnimator
{
public class AnimationManager : INotifyPropertyChanged
{
private float _currentTime;
public float CurrentTime
{
get { return _currentTime; }
set
{
_currentTime = value;
OnPropertyChanged("CurrentTime");
}
}
private bool _animating;
public bool Animating
{
get { return _animating; }
set
{
_animating = value;
OnPropertyChanged("Animating");
}
}
public ObservableCollection<Animation> Animations { get; set; }
public AnimationManager()
{
_animating = false;
_currentTime = 0.0f;
Animations = new ObservableCollection<Animation>();
Animations.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler((o, e) =>
{
OnPropertyChanged("Animations");
});
}
public void Start()
{
Animating = true;
}
public void Stop()
{
CurrentTime = 0.0f;
Animating = false;
}
public void Animate(float DeltaTime)
{
if (!Animating)
return;
CurrentTime += DeltaTime;
foreach (Animation a in Animations)
{
a.Animate(CurrentTime);
}
}
protected virtual void OnPropertyChanged(string propertyName)
{
if (PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
public event PropertyChangedEventHandler PropertyChanged;
}
}