FingerSliceTrail.cs 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using bbiwarg.Utility;
  7. namespace bbiwarg.Detectors.Fingers
  8. {
  9. class FingerSliceTrail
  10. {
  11. private List<FingerSlice> slices;
  12. public FingerSlice Start { get { return slices[0]; } }
  13. public FingerSlice End { get { return slices[slices.Count - 1]; } }
  14. public FingerSlice this[int index] { get { return slices[index]; } }
  15. public int NumSlices { get { return slices.Count; } }
  16. public LineSegment2D LineSegment { get { return new LineSegment2D(Start.Mid, End.Mid); } }
  17. public FingerSliceTrail(FingerSlice slice)
  18. {
  19. slices = new List<FingerSlice>();
  20. slices.Add(slice);
  21. }
  22. public void addSlice(FingerSlice slice)
  23. {
  24. slices.Add(slice);
  25. }
  26. public List<FingerSlice> getSlices()
  27. {
  28. return slices;
  29. }
  30. public void reverse() {
  31. slices.Reverse();
  32. }
  33. }
  34. }