public static List <IMoves> GetWillekeurigeMoves() { List <IMoves> moves = new List <IMoves>(); for (int i = 0; i < Random.Next(1, 8); i++) { int random = Random.Next(1, 4); IMoves move = null; switch (random) { case 1: move = new Backflip(); break; case 2: move = new Frontflip(); break; case 3: move = new Jump(); break; case 4: move = new Draai360(); break; } moves.Add(move); } return(moves); }
private void Move(IMoves target, double distanceTravelled) { var orbitRadius = target.Position.LocalCoordinates.Magnitude; var radiansTravelled = (distanceTravelled / orbitRadius); target.Position = target.Position.RotateZ(radiansTravelled); }
public static IMoves CreateMovesFromType(Types.MOVE_TYPES moveType, string value) { IMoves moves = CreateMovesFromType(moveType); moves.SetValue(value); return(moves); }
public bool AddMove(string matchId, string playerId, string moveValue) { Match match = Matches[matchId]; IPlayer player = match.Player1.Id == playerId ? match.Player1 : match.Player2; Game game; if (CurrentGames.ContainsKey(matchId) && CurrentGames[matchId] != null) { game = CurrentGames[matchId]; } else { game = new Game(match); CurrentGames[matchId] = game; } IMoves move = MovesFactory.CreateMovesFromType(MoveType); move.SetValue(moveValue); if (game.AddMove(player, move)) { match.AddNewGame(game); CurrentGames[matchId] = null; return(true); } return(false); }
public void DoeMove() { Random r = new Random(DateTime.Now.Second); HuidigeMove = Moves[r.Next(0, Moves.Count)]; Score += HuidigeMove.Move(); }
public void InitGame() { //var game = Control.Instance; //this.visualization.PrintStartMessage(); //var labyrinth = game.Setup.SetupNewLabyrinth(); //game.State.IsInitialized = true; IObjectFactory instanceFactory = new ObjectFactory(); Labyrinth labyrinth = new Labyrinth(LabyrinthSize, LabyrinthSize, instanceFactory); GameObjectsGenerator generator = new GameObjectsGenerator(); generator.GenerateObjectsNew(labyrinth); this.visualization.PrintMessage("Labyrinth is Ready"); this.visualization.DrawLabyrinth(labyrinth); MovesFactory movesFactory = new MovesFactory(labyrinth); while (!labyrinth.State.IsFinished) { IMoves move = this.visualization.GetUserCommand(movesFactory); move.Move(); this.visualization.DrawLabyrinth(labyrinth); } }
private Label CreateMoveLabel(IMoves move) { return(new Label() { Content = move.ToString(), Background = new SolidColorBrush(Colors.LightGray) }); }
private HUDViewController(IScore score, IMoves moves, IGoal goal, HUDView hudView) { _score = score; _hudView = hudView; _moves = moves; _goals = goal; Subscribe(); Hide(); }
public void SetHuidigeMove() { if (rand.Next(0, 4) == 0 && Moves.Count > 0) { int number = rand.Next(Moves.Count); HuidigeMove = Moves[number]; BehaaldePunten += HuidigeMove.Move(); return; } HuidigeMove = null; }
public Sporter(List <IMoves> moves) { Zwemvest = null; Moves = moves; Score = 0; HuidigeMove = null; Random random = new Random(); KledingKleur = new Tuple <byte, byte, byte>(Convert.ToByte(random.Next(0, 256)), Convert.ToByte(random.Next(0, 256)), Convert.ToByte(random.Next(0, 256))); }
public bool DoeMove() { if (Moves.Count != 0) { Random rnd = new Random(); move = Moves[rnd.Next(Moves.Count)]; aantalPunten += move.Move(); return(true); } return(false); }
public Sporter(List <IMoves> moves, Zwemvest zwemvest, Skies skies) { Moves = moves; Zwemvest = zwemvest; Skies = skies; if (Moves.Count() != 0) { HuidigeMove = Moves.First(); } else { HuidigeMove = null; } }
// Use this for initialization void Start() { Singleton.GetInstance().mgr = this;; alg = new Algos(); plr = new PlayerController(); enmy = new EnemyController(); plrI = plr; enmI = enmy; GenrateCivilians(10, 80, 80); // genrates non-repetable cordinates for civilians GenratePath(); // genrates random path IsInitialized = true; }
public static List <IMoves> GetWillekeurigeMoves() { List <IMoves> moves = new List <IMoves>(); Random rnd = new Random(); IMoves[] _possibleMoves = new IMoves[] { new Jump(), new Omdraaien(), new Eenbeen(), new Eenhand() }; int max = rnd.Next(1, _possibleMoves.Length + 1); for (int i = 0; i < max; i++) { moves.Add(_possibleMoves[i]); } return(moves); }
public int Move() { int totalScore = 0; if (Random.Next(0, 4) == 0 && Moves.Count > 0) { HuidigeMove = Moves[Random.Next(0, Moves.Count)]; totalScore += HuidigeMove.Move(); } else { HuidigeMove = null; } Score += totalScore; return(totalScore); }
public int Move() { int uitkomst; count++; if (count < Moves.Count) { uitkomst = HuidigeMove.Move(); HuidigeMove = Moves[count]; } else { uitkomst = 0; } HuidigeMove = Moves[count]; return(uitkomst); }
public void CreateLabel(int x, int y, int i, int lijnNmr, IMoves huidigeMove) { TextBox move = new TextBox(); if (huidigeMove != null) { move.Text = huidigeMove.ToString(); move.Background = Brushes.Transparent; move.BorderThickness = new Thickness(0); myCanvas.Children.Add(move); } TextBox text = new TextBox(); text.Text = $"{lijnNmr}"; text.Background = Brushes.Transparent; text.BorderThickness = new Thickness(0); myCanvas.Children.Add(text); if (i < 5) { Canvas.SetRight(text, (x + 10)); Canvas.SetTop(text, (y - 25)); Canvas.SetRight(move, x); Canvas.SetTop(move, y + 25); } else { Canvas.SetLeft(text, (x + 10)); Canvas.SetTop(text, (y + 25)); Canvas.SetLeft(move, x); Canvas.SetTop(move, y - 25); } TextBoxes.Add(text); TextBoxes.Add(move); }
public List <MoveSet> GetAllowedMoves() { IMoves move = MovesFactory.CreateMovesFromType(MoveType); return(move.GetAllowedMoves()); }
public static IHUDViewController CreateHUDViewController(IScore score, IMoves moves, IGoal goal, HUDView hudView) { return(HUDViewController.Create(score, moves, goal, hudView)); }
public void PositionRectangle(Rectangle rec, int wachtrij, int i, int lijnNmr, IMoves huidigeMove) { int x = 10 + (20 * i); int y = 50 * wachtrij; myCanvas.Children.Add(rec); Canvas.SetRight(rec, x); Canvas.SetTop(rec, y); // OP DE BAAN if (wachtrij == 6) { if (i < 5) { x = 100 + (125 * i); rec.Height = 20; rec.Width = 20; Canvas.SetRight(rec, x); Canvas.SetTop(rec, y); drawLine(x, y, i); CreateLabel(x, y, i, lijnNmr, huidigeMove); } else { x = 50 + (100 * (i - 4)); y = y - 125; rec.Height = 20; rec.Width = 20; Canvas.SetLeft(rec, x); Canvas.SetTop(rec, y); drawLine(x, y, i); CreateLabel(x, y, i, lijnNmr, huidigeMove); } } }