Example #1
0
 // private setters
 private void SetMovements(ParsedLog log)
 {
     foreach (CombatItem c in log.GetMovementData(AgentItem.InstID))
     {
         if (c.Time < FirstAware || c.Time > LastAware)
         {
             continue;
         }
         long   time = c.Time - log.FightData.FightStart;
         byte[] xy   = BitConverter.GetBytes(c.DstAgent);
         float  x    = BitConverter.ToSingle(xy, 0);
         float  y    = BitConverter.ToSingle(xy, 4);
         if (c.IsStateChange == ParseEnum.StateChange.Position)
         {
             CombatReplay.Positions.Add(new Point3D(x, y, c.Value, time));
         }
         else if (c.IsStateChange == ParseEnum.StateChange.Velocity)
         {
             CombatReplay.Velocities.Add(new Point3D(x, y, c.Value, time));
         }
         else if (c.IsStateChange == ParseEnum.StateChange.Rotation)
         {
             CombatReplay.Rotations.Add(new Point3D(x, y, c.Value, time));
         }
     }
 }