private void AnimatePlayerTeam() { var storyBoard = new Storyboard(); AnimatePlayer(storyBoard, TeamFormation[0].Location.XamlX * MatchAnimations.GetPitchWidth(MatchAnimations), MatchAnimations.Player1LeftProperty); AnimatePlayer(storyBoard, TeamFormation[0].Location.XamlY * MatchAnimations.GetPitchHeight(MatchAnimations), MatchAnimations.Player1TopProperty); AnimatePlayer(storyBoard, TeamFormation[1].Location.XamlX * MatchAnimations.GetPitchWidth(MatchAnimations), MatchAnimations.Player2LeftProperty); AnimatePlayer(storyBoard, TeamFormation[1].Location.XamlY * MatchAnimations.GetPitchHeight(MatchAnimations), MatchAnimations.Player2TopProperty); AnimatePlayer(storyBoard, TeamFormation[2].Location.XamlX * MatchAnimations.GetPitchWidth(MatchAnimations), MatchAnimations.Player3LeftProperty); AnimatePlayer(storyBoard, TeamFormation[2].Location.XamlY * MatchAnimations.GetPitchHeight(MatchAnimations), MatchAnimations.Player3TopProperty); AnimatePlayer(storyBoard, TeamFormation[3].Location.XamlX * MatchAnimations.GetPitchWidth(MatchAnimations), MatchAnimations.Player4LeftProperty); AnimatePlayer(storyBoard, TeamFormation[3].Location.XamlY * MatchAnimations.GetPitchHeight(MatchAnimations), MatchAnimations.Player4TopProperty); AnimatePlayer(storyBoard, TeamFormation[4].Location.XamlX * MatchAnimations.GetPitchWidth(MatchAnimations), MatchAnimations.Player5LeftProperty); AnimatePlayer(storyBoard, TeamFormation[4].Location.XamlY * MatchAnimations.GetPitchHeight(MatchAnimations), MatchAnimations.Player5TopProperty); AnimatePlayer(storyBoard, TeamFormation[5].Location.XamlX * MatchAnimations.GetPitchWidth(MatchAnimations), MatchAnimations.Player6LeftProperty); AnimatePlayer(storyBoard, TeamFormation[5].Location.XamlY * MatchAnimations.GetPitchHeight(MatchAnimations), MatchAnimations.Player6TopProperty); AnimatePlayer(storyBoard, TeamFormation[6].Location.XamlX * MatchAnimations.GetPitchWidth(MatchAnimations), MatchAnimations.Player7LeftProperty); AnimatePlayer(storyBoard, TeamFormation[6].Location.XamlY * MatchAnimations.GetPitchHeight(MatchAnimations), MatchAnimations.Player7TopProperty); AnimatePlayer(storyBoard, TeamFormation[7].Location.XamlX * MatchAnimations.GetPitchWidth(MatchAnimations), MatchAnimations.Player8LeftProperty); AnimatePlayer(storyBoard, TeamFormation[7].Location.XamlY * MatchAnimations.GetPitchHeight(MatchAnimations), MatchAnimations.Player8TopProperty); AnimatePlayer(storyBoard, TeamFormation[8].Location.XamlX * MatchAnimations.GetPitchWidth(MatchAnimations), MatchAnimations.Player9LeftProperty); AnimatePlayer(storyBoard, TeamFormation[8].Location.XamlY * MatchAnimations.GetPitchHeight(MatchAnimations), MatchAnimations.Player9TopProperty); AnimatePlayer(storyBoard, TeamFormation[9].Location.XamlX * MatchAnimations.GetPitchWidth(MatchAnimations), MatchAnimations.Player10LeftProperty); AnimatePlayer(storyBoard, TeamFormation[9].Location.XamlY * MatchAnimations.GetPitchHeight(MatchAnimations), MatchAnimations.Player10TopProperty); storyBoard.Begin(); }
private void AnimateComputerTeam(double possession = 0d) { var storyBoard = new Storyboard(); AnimatePlayer(storyBoard, ComputerTeamFormation[0].Location.XamlX * MatchAnimations.GetPitchWidth(MatchAnimations), MatchAnimations.ComputerPlayer1LeftProperty); AnimatePlayer(storyBoard, ComputerTeamFormation[0].Location.XamlY * MatchAnimations.GetPitchHeight(MatchAnimations), MatchAnimations.ComputerPlayer1TopProperty); AnimatePlayer(storyBoard, ComputerTeamFormation[1].Location.XamlX * MatchAnimations.GetPitchWidth(MatchAnimations), MatchAnimations.ComputerPlayer2LeftProperty); AnimatePlayer(storyBoard, ComputerTeamFormation[1].Location.XamlY * MatchAnimations.GetPitchHeight(MatchAnimations), MatchAnimations.ComputerPlayer2TopProperty); AnimatePlayer(storyBoard, ComputerTeamFormation[2].Location.XamlX * MatchAnimations.GetPitchWidth(MatchAnimations), MatchAnimations.ComputerPlayer3LeftProperty); AnimatePlayer(storyBoard, ComputerTeamFormation[2].Location.XamlY * MatchAnimations.GetPitchHeight(MatchAnimations), MatchAnimations.ComputerPlayer3TopProperty); AnimatePlayer(storyBoard, ComputerTeamFormation[3].Location.XamlX * MatchAnimations.GetPitchWidth(MatchAnimations), MatchAnimations.ComputerPlayer4LeftProperty); AnimatePlayer(storyBoard, ComputerTeamFormation[3].Location.XamlY * MatchAnimations.GetPitchHeight(MatchAnimations), MatchAnimations.ComputerPlayer4TopProperty); AnimatePlayer(storyBoard, ComputerTeamFormation[4].Location.XamlX * MatchAnimations.GetPitchWidth(MatchAnimations), MatchAnimations.ComputerPlayer5LeftProperty); AnimatePlayer(storyBoard, ComputerTeamFormation[4].Location.XamlY * MatchAnimations.GetPitchHeight(MatchAnimations), MatchAnimations.ComputerPlayer5TopProperty); AnimatePlayer(storyBoard, ComputerTeamFormation[5].Location.XamlX * MatchAnimations.GetPitchWidth(MatchAnimations), MatchAnimations.ComputerPlayer6LeftProperty); AnimatePlayer(storyBoard, ComputerTeamFormation[5].Location.XamlY * MatchAnimations.GetPitchHeight(MatchAnimations), MatchAnimations.ComputerPlayer6TopProperty); AnimatePlayer(storyBoard, ComputerTeamFormation[6].Location.XamlX * MatchAnimations.GetPitchWidth(MatchAnimations), MatchAnimations.ComputerPlayer7LeftProperty); AnimatePlayer(storyBoard, ComputerTeamFormation[6].Location.XamlY * MatchAnimations.GetPitchHeight(MatchAnimations), MatchAnimations.ComputerPlayer7TopProperty); AnimatePlayer(storyBoard, ComputerTeamFormation[7].Location.XamlX * MatchAnimations.GetPitchWidth(MatchAnimations), MatchAnimations.ComputerPlayer8LeftProperty); AnimatePlayer(storyBoard, ComputerTeamFormation[7].Location.XamlY * MatchAnimations.GetPitchHeight(MatchAnimations), MatchAnimations.ComputerPlayer8TopProperty); AnimatePlayer(storyBoard, ComputerTeamFormation[8].Location.XamlX * MatchAnimations.GetPitchWidth(MatchAnimations), MatchAnimations.ComputerPlayer9LeftProperty); AnimatePlayer(storyBoard, ComputerTeamFormation[8].Location.XamlY * MatchAnimations.GetPitchHeight(MatchAnimations), MatchAnimations.ComputerPlayer9TopProperty); AnimatePlayer(storyBoard, ComputerTeamFormation[9].Location.XamlX * MatchAnimations.GetPitchWidth(MatchAnimations), MatchAnimations.ComputerPlayer10LeftProperty); AnimatePlayer(storyBoard, ComputerTeamFormation[9].Location.XamlY * MatchAnimations.GetPitchHeight(MatchAnimations), MatchAnimations.ComputerPlayer10TopProperty); if (Math.Abs(possession) > 1E-6) { AnimatePossessionBar(storyBoard, 1000 * possession, MatchAnimations.HomePossessionProperty); AnimatePossessionBar(storyBoard, 1000 * (1 - possession), MatchAnimations.AwayPossessionProperty); } storyBoard.Begin(); }