Пример #1
0
        public override AbstractMasterActorSerializable GetCombatReplayJSON(CombatReplayMap map)
        {
            PlayerSerializable aux = new PlayerSerializable
            {
                Group     = Group,
                Img       = CombatReplay.Icon,
                Type      = "Player",
                ID        = GetCombatReplayID(),
                Positions = new double[2 * CombatReplay.Positions.Count],
                Dead      = new long[2 * CombatReplay.Deads.Count],
                Down      = new long[2 * CombatReplay.Downs.Count]
            };
            int i = 0;

            foreach (Point3D pos in CombatReplay.Positions)
            {
                (double x, double y) = map.GetMapCoord(pos.X, pos.Y);
                aux.Positions[i++]   = x;
                aux.Positions[i++]   = y;
            }
            i = 0;
            foreach ((long start, long end) in CombatReplay.Deads)
            {
                aux.Dead[i++] = start;
                aux.Dead[i++] = end;
            }
            i = 0;
            foreach ((long start, long end) in CombatReplay.Downs)
            {
                aux.Down[i++] = start;
                aux.Down[i++] = end;
            }

            return(aux);
        }
Пример #2
0
        public override string GetCombatReplayJSON(CombatReplayMap map)
        {
            Serializable aux = new Serializable
            {
                Group     = Group,
                Img       = CombatReplay.Icon,
                Type      = "Player",
                ID        = InstID,
                Positions = new int[2 * CombatReplay.Positions.Count],
                Dead      = new long[2 * CombatReplay.Deads.Count],
                Down      = new long[2 * CombatReplay.Downs.Count]
            };
            int i = 0;

            foreach (Point3D pos in CombatReplay.Positions)
            {
                Tuple <int, int> coord = map.GetMapCoord(pos.X, pos.Y);
                aux.Positions[i++] = coord.Item1;
                aux.Positions[i++] = coord.Item2;
            }
            i = 0;
            foreach (Tuple <long, long> status in CombatReplay.Deads)
            {
                aux.Dead[i++] = status.Item1;
                aux.Dead[i++] = status.Item2;
            }
            i = 0;
            foreach (Tuple <long, long> status in CombatReplay.Downs)
            {
                aux.Down[i++] = status.Item1;
                aux.Down[i++] = status.Item2;
            }

            return(JsonConvert.SerializeObject(aux));
        }
Пример #3
0
        public override AbstractMasterActorSerializable GetCombatReplayJSON(CombatReplayMap map, ParsedLog log)
        {
            if (CombatReplay == null)
            {
                InitCombatReplay(log);
            }
            MobSerializable aux = new MobSerializable
            {
                Img       = CombatReplay.Icon,
                Type      = "Mob",
                Positions = new double[2 * CombatReplay.Positions.Count],
                Start     = CombatReplay.TimeOffsets.start,
                End       = CombatReplay.TimeOffsets.end,
                ID        = GetCombatReplayID(log)
            };
            int i = 0;

            foreach (Point3D pos in CombatReplay.Positions)
            {
                (double x, double y) = map.GetMapCoord(pos.X, pos.Y);
                aux.Positions[i++]   = x;
                aux.Positions[i++]   = y;
            }

            return(aux);
        }
 public override object GetConnectedTo(CombatReplayMap map)
 {
     (double x, double y) = map.GetMapCoord(Position.X, Position.Y);
     return(new double[2]
     {
         x,
         y
     });
 }
Пример #5
0
        public override object GetConnectedTo(CombatReplayMap map)
        {
            Tuple <int, int> mapPos = map.GetMapCoord(_position.X, _position.Y);

            return(new int[2]
            {
                mapPos.Item1,
                mapPos.Item2
            });;
        }
Пример #6
0
        public override AbstractMasterActorSerializable GetCombatReplayJSON(CombatReplayMap map)
        {
            TargetSerializable aux = new TargetSerializable
            {
                Img       = CombatReplay.Icon,
                Type      = "Target",
                ID        = GetCombatReplayID(),
                Start     = CombatReplay.TimeOffsets.start,
                End       = CombatReplay.TimeOffsets.end,
                Positions = new double[2 * CombatReplay.Positions.Count]
            };
            int i = 0;

            foreach (Point3D pos in CombatReplay.Positions)
            {
                (double x, double y) = map.GetMapCoord(pos.X, pos.Y);
                aux.Positions[i++]   = x;
                aux.Positions[i++]   = y;
            }
            return(aux);
        }
Пример #7
0
        public override string GetCombatReplayJSON(CombatReplayMap map)
        {
            Serializable aux = new Serializable
            {
                Img       = CombatReplay.Icon,
                Type      = "Target",
                ID        = GetCombatReplayID(),
                Start     = CombatReplay.TimeOffsets.Item1,
                End       = CombatReplay.TimeOffsets.Item2,
                Positions = new int[2 * CombatReplay.Positions.Count]
            };
            int i = 0;

            foreach (Point3D pos in CombatReplay.Positions)
            {
                Tuple <int, int> coord = map.GetMapCoord(pos.X, pos.Y);
                aux.Positions[i++] = coord.Item1;
                aux.Positions[i++] = coord.Item2;
            }

            return(JsonConvert.SerializeObject(aux));
        }