public SpellCast(Fight fight, GameActionFightSpellCastMessage msg) { Caster = fight.GetFighter(msg.sourceId); if (Caster == null) { logger.Error("Fighter {0} not found as he casted spell {1}", msg.sourceId, msg.spellId); } Spell = ObjectDataManager.Instance.Get <Spell>(msg.spellId); SpellLevel = ObjectDataManager.Instance.Get <SpellLevel>((int)Spell.spellLevels[msg.spellLevel - 1]); Target = fight.Map.Cells[msg.destinationCellId]; RoundCast = fight.Round; Critical = (FightSpellCastCriticalEnum)msg.critical; SilentCast = msg.silentCast; TargetedFighter = fight.GetFighter(msg.targetId); }
public void RefreshTimeLine(IEnumerable <int> ids) { var timeLine = ids.Select(entry => Fight.GetFighter(entry)); m_fighters.Clear(); foreach (var fighter in timeLine) { m_fighters.Add(fighter); } }
public void Update(GameFightSynchronizeMessage msg) { if (msg == null) { throw new ArgumentNullException("msg"); } var timeLine = msg.fighters.Select(entry => Fight.GetFighter(entry.contextualId)); m_fighters.Clear(); m_fighters.AddRange(timeLine); }