This commit is contained in:
2021-05-13 22:18:51 +08:00
parent 7259c36da1
commit 1d700a02e3
10 changed files with 298 additions and 198 deletions

View File

@ -38,15 +38,26 @@ namespace BallanceTASEditor.Core {
}
}
public int Get(ObservableCollection<FrameDataDisplay> container, long startIndex, int count) {
if (mPointer == null) return 0;
public void Get(List<FrameDataDisplay> container, long startIndex, int count) {
// no item. clean container
if (mPointer == null) {
for(int j = 0; j < count; j++) {
container[j].isEnable = false;
}
return;
}
// fill container
var cachePointer = mPointer;
int i;
for(i = 0; i < count && cachePointer != null; i++, startIndex++) {
container[i].Reload(startIndex, cachePointer.Value);
container[i].isEnable = true;
cachePointer = cachePointer.Next;
}
return i;
for(; i < count; i++) {
container[i].isEnable = false;
}
}
public void Set(FrameDataField field, long prevRange, long nextRange, bool isSet) {

View File

@ -8,6 +8,7 @@ using System.Text;
namespace BallanceTASEditor.Core.TASStruct {
public class FrameDataDisplay : INotifyPropertyChanged {
public FrameDataDisplay(long index, FrameData fd) {
isEnable = true;
Reload(index, fd);
}
@ -26,6 +27,7 @@ namespace BallanceTASEditor.Core.TASStruct {
this.keystates = fd.keystates;
}
public bool isEnable { get; set; }
public long index { get; set; }
public float deltaTime { get; set; }
public UInt32 keystates {