Exemple #1
0
        private void GetDirectionalAbility(MovementDirection direction)
        {
            AnimatedAbility ability        = null;
            MovementMember  movementMember = null;

            switch (direction)
            {
            case MovementDirection.Left:
                movementMember = SelectedMovement.MovementMembers.FirstOrDefault(mm => mm.MovementDirection == MovementDirection.Left);
                ability        = movementMember.MemberAbility.Reference;
                break;

            case MovementDirection.Right:
                break;

            case MovementDirection.Forward:
                break;

            case MovementDirection.Backward:
                break;

            case MovementDirection.Upward:
                break;

            case MovementDirection.Downward:
                break;

            case MovementDirection.Still:
                break;
            }
        }
        public Movement Clone()
        {
            Movement clonedMovement = new MovementImpl(this.Name);

            clonedMovement.HasGravity = this.HasGravity;
            clonedMovement.MovementMembers.Clear();
            foreach (MovementMember member in this.MovementMembers)
            {
                MovementMember clonedMember = member.Clone();
                clonedMovement.MovementMembers.Add(clonedMember);
            }

            return(clonedMovement);
        }
        private async Task AdvanceInMovementDirection(List <MovableCharacter> targets)
        {
            MovableCharacter target         = GetLeadingCharacterForMovement(targets);
            MovementMember   movementMember = this.MovementMembers.First(mm => mm.Direction == target.DesktopNavigator.Direction);

            if (!target.DesktopNavigator.IsInCollision)
            {
                Key key = movementMember.Key;
                if (movementMember.Direction != Direction.Still)//&& Keyboard.IsKeyDown(key))
                {
                    List <Position> followerPositions = targets.Where(t => t != target).Select(t => t.Position).ToList();
                    followerPositions.AddRange(targets.Where(t => t.GhostShadow != null).Select(t => t.GhostShadow.Position));
                    await target.DesktopNavigator.Navigate(target.Position, movementMember.Direction, this.Speed, this.HasGravity, followerPositions);

                    //targets.ForEach(t => t.AlignGhost());
                }
            }
        }
Exemple #4
0
        private void LoadAbilityEditor(object state)
        {
            MovementMember member = state as MovementMember;

            eventAggregator.GetEvent <EditAbilityEvent>().Publish(new Tuple <AnimatedAbility, Character>(member.MemberAbility.Reference, this.defaultCharacter));
        }
Exemple #5
0
        private void DemoDirectionalMovement(object state)
        {
            MovementMember member = state as MovementMember;

            member.MemberAbility.Reference.Play(false, this.CurrentCharacterMovement.Character);
        }
Exemple #6
0
        private bool CanDemoDirectionalMovement(object state)
        {
            MovementMember member = state as MovementMember;

            return(member != null && member.MemberAbility != null && member.MemberAbility.Reference != null);
        }
Exemple #7
0
        public void LoadAbilityEditor(object state)
        {
            MovementMember member = state as MovementMember;

            EventAggregator.Publish(new EditAnimatedAbilityEvent(member.Ability), action => System.Windows.Application.Current.Dispatcher.Invoke(action));
        }
Exemple #8
0
        public void DemoDirectionalMovement(object state)
        {
            MovementMember member = state as MovementMember;

            member.Ability.Play(this.CurrentCharacterMovement.Owner as AnimatedCharacter);
        }