protected override void Do() { TargetList.Clear(); TargetList.Add(Owner.Mgr.Raid.GetRandom()); Target.TakeDamage(TotalPower); base.Do(); }
public void Init() { if (LoadValue != null) { var l = LoadValue(); TargetList.Clear(); if (l != null) { TargetList.Add(l); } } }
///// <summary> ///// 停止并销毁该集群管理 ///// </summary> //private void Stop() //{ // ClearAll(); // isStop = true; // LooperManager.Single.Remove(looperNum); // single = null; //} /// <summary> /// 清除所有组 /// </summary> public void ClearAll() { // 清除数据 if (targetList != null) { foreach (var item in targetList.List) { item.Clear(); } } if (targetList != null) { targetList.Clear(); } }
private void ScanProjection(List <IMySlimBlock> blocks) { using (m_lock.AcquireExclusiveUsing()) { TargetList.Clear(); PotentialTargetList.Clear(); } HashSet <IMyEntity> entities = new HashSet <IMyEntity>(); MyAPIGateway.Entities.GetEntities(entities, x => x is IMyCubeGrid && x.Physics == null); foreach (var item in blocks) { CheckBlockProjection(item); } foreach (var beaconBlock in NaniteConstructionManager.BeaconList.Where(x => x is NaniteBeaconProjection && Vector3D.DistanceSquared(m_constructionBlock.ConstructionBlock.GetPosition(), x.BeaconBlock.GetPosition()) < m_maxDistance * m_maxDistance)) { IMyCubeBlock item = (IMyCubeBlock)beaconBlock.BeaconBlock; if (!((IMyFunctionalBlock)item).Enabled || !((IMyFunctionalBlock)item).IsFunctional) { continue; } MyRelationsBetweenPlayerAndBlock relation = item.GetUserRelationToOwner(m_constructionBlock.ConstructionBlock.OwnerId); if (!(relation == MyRelationsBetweenPlayerAndBlock.Owner || relation == MyRelationsBetweenPlayerAndBlock.FactionShare || (MyAPIGateway.Session.CreativeMode && relation == MyRelationsBetweenPlayerAndBlock.NoOwnership))) { continue; } List <IMyCubeGrid> beaconGridList = GridHelper.GetGridGroup((IMyCubeGrid)item.CubeGrid); List <IMySlimBlock> beaconBlocks = new List <IMySlimBlock>(); foreach (var grid in beaconGridList) { grid.GetBlocks(beaconBlocks); } foreach (var block in beaconBlocks) { CheckBlockProjection(block); } } CheckAreaBeacons(); }
/// <summary> /// 清理掉所有对象 /// </summary> private void CleanAllMember() { MemberList.Clear(); }