static List <Turn> CleanUpSequenceOnePass(List <Turn> src) { var result = new List <Turn>(); Side side = (Side)0; Rotation direction = Rotation.None; foreach (var item in src) { if (item.Side != side) { // push current side if (direction != Rotation.None) { result.Add(new Turn(side, direction)); } // init new current side = item.Side; direction = item.Direction; } else { // side repeat direction = direction.Add(item.Direction); } } if (direction != Rotation.None) { result.Add(new Turn(side, direction)); } return(result); }
public virtual void ReadChildData(BinaryReader reader) { int x = 0; _bitmap.ReadString(reader); for (x = 0; (x < _reflections.Count); x = (x + 1)) { Reflections.Add(new LensFlareReflectionBlockBlock()); Reflections[x].Read(reader); } for (x = 0; (x < _reflections.Count); x = (x + 1)) { Reflections[x].ReadChildData(reader); } for (x = 0; (x < _brightness.Count); x = (x + 1)) { Brightness.Add(new LensFlareScalarAnimationBlockBlock()); Brightness[x].Read(reader); } for (x = 0; (x < _brightness.Count); x = (x + 1)) { Brightness[x].ReadChildData(reader); } for (x = 0; (x < _color.Count); x = (x + 1)) { Color.Add(new LensFlareColorAnimationBlockBlock()); Color[x].Read(reader); } for (x = 0; (x < _color.Count); x = (x + 1)) { Color[x].ReadChildData(reader); } for (x = 0; (x < _rotation.Count); x = (x + 1)) { Rotation.Add(new LensFlareScalarAnimationBlockBlock()); Rotation[x].Read(reader); } for (x = 0; (x < _rotation.Count); x = (x + 1)) { Rotation[x].ReadChildData(reader); } }