public EnemyActionProcesser(Enemy enemy, EnemyActionData data)
            {
                _Enemy = enemy;
                _Data  = data;
                if (data.AttackData.Count() == 0)
                {
                    _AttackProcesser = new NullAttackProcesser();
                }
                else
                {
                    _AttackProcesser = new EnemyAttackProcesser(data.AttackData, enemy);
                }
                _MoveProcesser    = new EnemyMoveProcesser(enemy, data.MoveData);
                _CompleteObserver = new Subject <Unit> ();
                _AttackProcesser.CompleteAsObservable()
                .Zip(_MoveProcesser.CompleteAsObservable(), (l, r) => r)
                .First()
                .Subscribe(_ => _CompleteObserver.OnNext(Unit.Default));

                _CompleteObserver.Subscribe(_ => _Process = _FirstProcess);

                _Process = _FirstProcess;
            }
示例#2
0
 public static bool CB(CSVReader csv, EnemyActionData data, ref uint key1)
 {
     csv.Pop(ref data.actionID);
     csv.Pop(ref data.name);
     for (int i = 0; i < 5; i++)
     {
         csv.Pop(ref data.combiActionNames[i]);
         data.combiActionTypeInfos[i] = GetActionTypeInfo(data.combiActionNames[i]);
     }
     for (int j = 0; j < 4; j++)
     {
         csv.Pop(ref data.distanceWeights[j]);
     }
     for (int k = 0; k < 4; k++)
     {
         csv.Pop(ref data.placeWeights[k]);
     }
     csv.Pop(ref data.nearMultiPlayerWeight);
     csv.Pop(ref data.isUse);
     csv.Pop(ref data.isRotate);
     csv.Pop(ref data.atkRange);
     csv.Pop(ref data.afterWaitTime);
     for (int l = 0; l < 3; l++)
     {
         data.regionFlags[l] = new RegionFlag();
         csv.Pop(ref data.regionFlags[l].name);
         csv.Pop(ref data.regionFlags[l].flag);
     }
     csv.Pop(ref data.angryId);
     csv.Pop(ref data.validAngryId);
     csv.Pop(ref data.lotteryWaitInterval);
     csv.Pop(ref data.isCounterAttack);
     csv.Pop(ref data.useLvLimit);
     csv.Pop(ref data.modeId);
     csv.Pop(ref data.startWaitInterval);
     return(true);
 }