public void InitializeGameState() { backGroundImage = new Entity( new StationaryShape(new Vec2F(0.0f, 0.0f), new Vec2F(1.0f, 1.0f)), new Image(Path.Combine("Assets", "Images", "SpaceBackground.png"))); player = new Player(); enemies = new EntityContainer <Enemy>(); enemyStrides = ImageStride.CreateStrides(4, Path.Combine("Assets", "Images", "BlueMonster.png")); var sqr = new Squadron2(); sqr.CreateEnemies(enemyStrides); enemies = sqr.Enemies; movementStrategy = new ZigZagDown(); playerShots = new EntityContainer(); shotStride = new Image(Path.Combine("Assets", "Images", "BulletRed2.png")); explosionStrides = ImageStride.CreateStrides(8, Path.Combine("Assets", "Images", "Explosion.png")); explosions = new AnimationContainer(4); }
public StandartTwoPlayerEngine(IRenderer renderer, IInputProvider input) { this._renderer = renderer; this._input = input; this._board = new Board(); this._movementStrategy = new NormalMovementStrategy(); }
public FriendlyNPC(IPosition position, IStats stats, IMovementStrategy movementStrategy, string name = "Friendly McName") { this.Position = position; this.Stats = stats; this.MovementStrategy = movementStrategy; this.Name = name; }
public ChessPiece(ChessPieceColor color, ChessPieceType type, Position position, IMovementStrategy movementStrategy) { Color = color; Type = type; Position = position; movement = movementStrategy; }
public StandartTwoPlayerEngine(IRenderer renderer, IInputProvider provider) { this.renderer = renderer; this.board = new Board.Board(); this.input = provider; this.movementStrategy = new NormalMovementStrategy(); }
/// <summary> /// Create a new GamePiece /// </summary> /// <param name="sides">No of sides the game piece should have.</param> /// <param name="mainState">Default or alt state</param> /// <param name="visible">Set initial piece visibility</param> public GamePiece(int typeID, string typeName, IMovementStrategy movementStrategy, bool visible) { TypeID = typeID; TypeName = typeName; Visible = visible; _movementStrategy = movementStrategy; }
public TwoPlayerEngine(IRenderer render, IInputProvider inputProvider) { this.renderer = render; this.input = inputProvider; this.movementStrategy = new NormalMovementStrategy(); this.board = new TheBoard(); }
public StandardTwoPlayerEngine(IRenderer renderer, IInputProvider inputProvider) { this.renderer = renderer; this.input = inputProvider; movementStrategy = new NormalMovementStrategy(); this.board = new Board(); }
/// <summary> /// Initializes a new instance of the <see cref="AI"/> class. /// </summary> /// <param name="pos">the starting enemy pos</param> /// <param name="type">the type of enemy</param> /// <param name="rotation">the starting rotation of the enemy</param> /// <param name="walls">the collections of points that impair the enemy's sight</param> public AI(Point2D pos, EnemyType type, double rotation, HashSet <Point2D> walls) { this._current = pos; this._strategy = this.GetStrategy(type); this._rotation = rotation; this.GetWallSet = walls; }
protected BaseChessEngine(IRenderer renderer, IInputProvider inputProvider, IMovementStrategy movementStrategy) { this.Renderer = renderer; this.MovementStrategy = movementStrategy; this.Input = inputProvider; this.Board = new Board(); this.GameState = GameState.Playing; }
public ChessStandardGame() { this.gameBoard = new StandardBoardGame(); this.whitePlayer = new Player("White Player", FigureColor.White, State.OnTheMove); this.blackPlayer = new Player("Black Player", FigureColor.Black, State.NotOnTheMove); this.renderer = new Renderer(); this.strategy = new MovementStrategy(); }
public StandardTwoPlayerEngine(IRenderer renderer, IInputProvider inputProvider, bool testing = false) { this.renderer = renderer; this.input = inputProvider; this.movementStrategy = new NormalMovementStrategy(); this.board = new Board(); this.testing = testing; }
public Invasion() { MaxEnemies = 11; Enemies = new EntityContainer <Enemy>(MaxEnemies); timer = new GameTimer(60, 60); MovementStrategy = new ZigZagDown(); }
private void InitMovement( IMovementStrategy movement, IStatus status, float speed, IInputService input) { this.movement = movement; movement.Construct(status, speed, input); }
public StandardTwoPlayerEngine( IRenderer renderer, IInputProvider inputProvider) { this._renderer = renderer; this._inputProvider = inputProvider; this._board = new Board.Board(); this._movementStrategies = new NormalMovementStrategy(); this._inPassing = new List <IFigure>(); }
public Boss() { Enemies = new EntityContainer <Enemy>(); size = new Vec2F(0.3f, 0.3f); startPosition = new Vec2F( 0.5f - size.X / 2.0f, 1 - size.X); MovementStrategy = new ZigZagDown(); }
public HostileNPC(IPosition position, IStats stats, IMovementStrategy movementStrategy, string name = "Hostile McGuy", int droppedGold = 0) { this.Position = position; this.Stats = stats; this.MoveStrategy = movementStrategy; this.Name = name; this.DroppedGold = droppedGold; DroppedExperience = stats.MaxHealth * stats.Damage; }
public StandardTwoPlayerEngine(IRenderer renderer, IInputProvider inputProvider) { this.renderer = renderer; this.input = inputProvider; this.movementStrategy = new NormalMovementStrategy(); this.board = new Board(); this.players = new List <IPlayer>(); this.movedFigures = new MovedFigures(); }
//private static int number = 0; //private int index = 0; public override void Awake() { base.Awake(); hashAttack = Animator.StringToHash("Attack"); hashDeath = Animator.StringToHash("Death"); ownHealth = GetComponent <Health>(); movement = new NavMeshMovement(); //number++; //index = number; //Index = index; }
/// <summary> /// If the second paramter is passed null then the default movement strategy is used /// Use this move method if you want to change the strategy after the Rover object has been instantiated /// </summary> /// <param name="command"></param> /// <param name="strategy"></param> public void move(char command, IMovementStrategy strategy) { if (strategy != null) { strategy.move(command); } else { defaultMoveStrategy(command); } }
public IChessEngine GetEngine(GameType gameType, IRenderer renderer, IInputProvider inputProvider, IMovementStrategy movementStrategy) { switch (gameType) { case GameType.Chess: return new StandartTwoPlayerEngine(renderer, inputProvider, movementStrategy); case GameType.KingSurvival: return new KingSurvivalEngine(renderer, inputProvider, movementStrategy); default: throw new ArgumentException(); } }
public void Construct( IInputService input, IStatus status, IMovementStrategy movement, float moveSpeed) { MaxHealth = health; InitMovement(movement, status, moveSpeed, input); InitCasting(); InitInputHandlers(input); InitStatus(status); }
public SquadronBox(int ratio, IMovementStrategy desiredMovement) { // Create an empty container for the enemies. Enemies = new EntityContainer <Enemy>(MaxEnemies); // Ratio for choosing enemy strides strongEnemyRatio = ratio; // The chosen movement strategy movementStrategy = desiredMovement; // Instantiate the enemies. CreateEnemies(); }
public StandardTwoPlayerEngine(ContainerConsole container) { movementStrategy = new NormalMovementStrategy(); renderer = new ConsoleRenderer(container); selectedPositions = new List <Position>(); scoreBoard = new ScoreBoard(container); board = new Board(); // main event that drives the game renderer.Console.MouseMove += MouseClickOnBoard; // keyboard keyboardHandler = new KeyboardHandler(this); container.IsFocused = true; container.Components.Add(keyboardHandler); }
void Start() { Unit = GetComponent <Unit>(); // Events that cause the strategy to change Unit.OnCelestialBodyArrival += cb => this.Strategy = Strategy.UnitArrivedAtCelestialBody(cb); Unit.OnCelestialBodyMoveTo += cb => this.Strategy = Strategy.UnitMoveToCelestialBody(cb); if (Unit.IsOnCelestialBody()) { Strategy = new MovementStrategyOrbitingCelestialBody(Unit, Unit.GetCurrentCelestialBody()); } else { Strategy = new MovementStrategyMoveToCelestialBody(Unit, Unit.GetTargetCelestialBody()); } }
public Piece BuildPiece(bool white, int xx, int yy, IMovementStrategy str) { p = new King(xx, yy); if (white) { p.texture.ImageSource = new BitmapImage(new Uri("images\\king_w.png", UriKind.Relative)); p.rect.Fill = p.texture; p.c = 'K'; p.ims = str; } else { p.texture.ImageSource = new BitmapImage(new Uri("images\\king_b.png", UriKind.Relative)); p.rect.Fill = p.texture; p.c = 'k'; p.ims = str; } return(p); }
private ISquadron GetSquadron(SquadronTypes desiredSquadron) { IMovementStrategy chosenMovement = GetMovement(PossibleMovements[Rand.Next(PossibleMovements.Length)]); switch (desiredSquadron) { case (SquadronTypes.Box): return(new SquadronBox(StrongEnemyRatio, chosenMovement)); case (SquadronTypes.Line): return(new SquadronLine(StrongEnemyRatio, chosenMovement)); case (SquadronTypes.Diamonds): return(new SquadronDiamonds(StrongEnemyRatio, chosenMovement)); default: throw new ArgumentException("Type conflict setting squadron."); } }
public Game() { gameTimer = new GameTimer(60, 60); win = new Window("Galaca", 500, AspectRatio.R1X1); backGround = new Image(Path.Combine("Assets", "Images", "SpaceBackground.png")); player = new Player(); enemies = new EntityContainer <Enemy>(); enemyStrides = ImageStride.CreateStrides(4, Path.Combine("Assets", "Images", "BlueMonster.png")); var sqr = new Squadron2(); sqr.CreateEnemies(enemyStrides); enemies = sqr.Enemies; movementStrategy = new ZigZagDown(); playerShots = new EntityContainer(); shotStride = new Image(Path.Combine("Assets", "Images", "BulletRed2.png")); explosionStrides = ImageStride.CreateStrides(8, Path.Combine("Assets", "Images", "Explosion.png")); explosions = new AnimationContainer(4); eventBus = new GameEventBus <object>(); eventBus.InitializeEventBus(new List <GameEventType>() { GameEventType.InputEvent, GameEventType.WindowEvent, GameEventType.PlayerEvent }); win.RegisterEventBus(eventBus); eventBus.Subscribe(GameEventType.InputEvent, this); eventBus.Subscribe(GameEventType.WindowEvent, this); }
public abstract ICollection <IMovement> Move(IMovementStrategy strategy);
public abstract ICollection<IMovement> Move(IMovementStrategy strategy);
public KingSurvivalEngine(IRenderer renderer, IInputProvider inputProvider, IMovementStrategy movementStrategy) : base(renderer, inputProvider, movementStrategy) { }
public King(char symbol, IPosition position, IMovementStrategy movementStrategy) : base(symbol, position, movementStrategy) { this.MovesCount = InitialMovesCount; }
public override ICollection<IMovement> Move(IMovementStrategy strategy) { var movememts = strategy.GetMovements(this.GetType().Name); return movememts; }
public Pawn(char symbol, IPosition position, IMovementStrategy movementStrategy) : base(symbol, position, movementStrategy) { }
public Breakthrough(IMovementStrategy movementStrategy) { _movementStrategy = movementStrategy; InitializeBoard(); _currentPlayer = PlayerType.White; }
public ICollection<IMovement> Move(IMovementStrategy strategy) { return strategy.Moves(this.Type); }
public StandartTwoPlayerEngine(IRenderer renderer, IInputProvider inputProvider, IMovementStrategy movementStrategy) : base(renderer, inputProvider, movementStrategy) { }
public override ICollection<IMovement> Move(IMovementStrategy strategy) { throw new System.NotImplementedException(); }
public void SetMovementStrategy(MovementStrategyEnum movementStrategy) { _movementStrategy = _movementStrategyInvoker.GetMovementStrategy(movementStrategy); }
public override ICollection <IMovement> Move(IMovementStrategy movementStrategy) { throw new System.NotImplementedException(); }
public CPDefault(List <Spell> spells, ICombatClass spellStrategy, IMovementStrategy movementStrategy) { Spells = spells; SpellStrategy = spellStrategy; MovementStrategy = movementStrategy; }
public override ICollection<IMovement> Move(IMovementStrategy movementStrategy) { return movementStrategy.GetMovements(this.GetType().Name); }
public override ICollection <IMovement> Move(IMovementStrategy strategy) { return(strategy.GetMovements(this.GetType().Name)); }
protected Figure(char symbol, IPosition position, IMovementStrategy movementStrategy) { this.Symbol = symbol; this.Position = position; this.MovementStrategy = movementStrategy; }