コード例 #1
0
 protected override void Execute()
 {
     MovePathAction ma = new MovePathAction(this.Source, path, this.Source.Module<MoveModule>().MoveDuration);
     AttackUnitAction aa = new AttackUnitAction(this.attackUnit);
     PlayerDeclareMoveAttackEvent evt = new PlayerDeclareMoveAttackEvent(player,(UnitEntity)this.Source,this.attackUnit,ma,aa);
     this.EventManager.Raise(evt);
 }
コード例 #2
0
        protected override void Execute()
        {
            MovePathAction               ma  = new MovePathAction(this.Source, path, this.Source.Module <MoveModule>().MoveDuration);
            AttackUnitAction             aa  = new AttackUnitAction(this.attackUnit);
            PlayerDeclareMoveAttackEvent evt = new PlayerDeclareMoveAttackEvent(player, (UnitEntity)this.Source, this.attackUnit, ma, aa);

            this.EventManager.Raise(evt);
        }
コード例 #3
0
        public void OnPlayerDeclare(PlayerDeclareMoveAttackEvent evt)
        {
            Path <TileWorld, TilePosition> path;

            if (this.routes.TryGetValue(evt.Entity, out path))
            {
                this.unDrawRoute(path);
                this.routes.Remove(evt.Entity);
            }

            this.routes.Add(evt.Entity, evt.MoveAction.Path);
            this.drawRoute(evt.MoveAction.Path, Color.red);
        }
コード例 #4
0
ファイル: TurnManager.cs プロジェクト: jannickj/cruel-nemesis
        private void OnPlayerDeclareMoveAttack(PlayerDeclareMoveAttackEvent evt)
        {
            if (currentPhase == Phases.Declare && evt.Player == playersTurn)
            {
                PlayerDeclareMoveAttackEvent oldevt;
                if (moveAttackDeclaration.TryGetValue(evt.Entity, out oldevt) && oldevt.AttackUnit != null)
                {
                    oldevt.AttackUnit.Raise(new UnitDeclaredAsAttacked(evt.AttackUnit, evt.Entity, false));
                }

                moveAttackDeclaration[evt.Entity] = evt;

                if (evt.AttackUnit != null)
                {
                    var attackee = evt.Entity;
                    var attacked = evt.AttackUnit;
                    evt.AttackUnit.Raise(new UnitDeclaredAsAttacked(attacked, attackee, true));
                }
            }
        }
コード例 #5
0
        public void OnPlayerDeclare(PlayerDeclareMoveAttackEvent evt)
        {
            Path<TileWorld,TilePosition> path;
            if(this.routes.TryGetValue(evt.Entity,out path))
            {
                this.unDrawRoute(path);
                this.routes.Remove(evt.Entity);
            }

            this.routes.Add(evt.Entity, evt.MoveAction.Path);
            this.drawRoute(evt.MoveAction.Path,Color.red);
        }
コード例 #6
0
ファイル: TurnManager.cs プロジェクト: jannickj/cruel-nemesis
        private void OnPlayerDeclareMoveAttack(PlayerDeclareMoveAttackEvent evt)
        {
            if (currentPhase == Phases.Declare && evt.Player == playersTurn)
            {
                PlayerDeclareMoveAttackEvent oldevt;
                if (moveAttackDeclaration.TryGetValue(evt.Entity, out oldevt) && oldevt.AttackUnit != null)
                {
                    oldevt.AttackUnit.Raise(new UnitDeclaredAsAttacked(evt.AttackUnit, evt.Entity, false));
                }

                moveAttackDeclaration[evt.Entity] = evt;

                if (evt.AttackUnit != null)
                {
                    var attackee = evt.Entity;
                    var attacked = evt.AttackUnit;
                    evt.AttackUnit.Raise(new UnitDeclaredAsAttacked(attacked, attackee, true));
                }

            }
        }