public void Move(HeroMoveInfo info) { if (info.type == GetHeroInfo().type || info.ori.Equals(TemSimpleBlock)) { if (m_strategy is CustomStrategy) { ((CustomStrategy)m_strategy).target = info.target; ((CustomStrategy)m_strategy).direction = info.toDirection; ((CustomStrategy)m_strategy).isActive = info.isActive; } } }
// public bool IsInAttackRange( Block b ) // { // int attackRange = GetHeroInfo ().AttackRange; // if (b != null && TemBlock != null) { // if (TemBlock.GetDistance (b) <= attackRange) // return true; // } // // return false; // } // // public bool IsInMoveRange( Block b ) // { // int moveRange = GetHeroInfo ().MoveRange; // if (b != null && TemBlock != null) { // if (TemBlock.GetDistance (b) <= moveRange) // return true; // } // // return false; // } public HeroMoveInfo GetMoveInfo() { HeroMoveInfo res = new HeroMoveInfo(); res.ID = GetHeroInfo().ID; res.ori = TemSimpleBlock; res.target = m_strategy.GetTarget(); res.toDirection = m_strategy.GetDirection(); res.type = GetHeroInfo().type; res.isActive = m_strategy.GetActive(); return(res); }
public HeroMoveInfo Copy() { HeroMoveInfo res = new HeroMoveInfo(); res.ID = ID; res.target = target; res.toDirection = toDirection; res.isActive = isActive; res.ori = ori; res.type = type; return(res); }