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()); } } }
private void LoadAbilityEditor(object state) { MovementMember member = state as MovementMember; eventAggregator.GetEvent <EditAbilityEvent>().Publish(new Tuple <AnimatedAbility, Character>(member.MemberAbility.Reference, this.defaultCharacter)); }
private void DemoDirectionalMovement(object state) { MovementMember member = state as MovementMember; member.MemberAbility.Reference.Play(false, this.CurrentCharacterMovement.Character); }
private bool CanDemoDirectionalMovement(object state) { MovementMember member = state as MovementMember; return(member != null && member.MemberAbility != null && member.MemberAbility.Reference != null); }
public void LoadAbilityEditor(object state) { MovementMember member = state as MovementMember; EventAggregator.Publish(new EditAnimatedAbilityEvent(member.Ability), action => System.Windows.Application.Current.Dispatcher.Invoke(action)); }
public void DemoDirectionalMovement(object state) { MovementMember member = state as MovementMember; member.Ability.Play(this.CurrentCharacterMovement.Owner as AnimatedCharacter); }