private bool Run(List <BoardCellLocation> shipLocations) { try { IStateTracker stateTracker = stateTrackerFactory.Create(); LogGameStatus(stateTracker); Log($"Building board"); stateTracker.BuildBoard(); LogGameStatus(stateTracker); //var logText = shipLocations.Select(x => x.ToString()).ToList<string>(); Log($"Adding ship to : {string.Join(",", shipLocations.Select(x => x.ToString()).ToList<string>())}"); stateTracker.AddShip(shipLocations); LogGameStatus(stateTracker); shipLocations.ForEach (x => { Log($"Attacking : ({x.ToString()})"); stateTracker.Attack(x); LogGameStatus(stateTracker); }); return(true); } catch (Exception ex) { Log(ex.Message); return(false); } }
public MeerkatAppViewModel(IStateTracker stateTracker, ITodoTracker todoTracker, DispatcherTimer dispatcherTimer) { this.stateTracker = stateTracker; this.todoTracker = todoTracker; this.dispatcherTimer = dispatcherTimer; this.dispatcherTimer.Tick += new System.EventHandler(TimeChanged); }
public StartGameAdminCommand(int size, IPhysics physics, IStateTracker stateTracker, IPlayerRepository playerRepository) { _size = size; _physics = physics; _stateTracker = stateTracker; _playerRepository = playerRepository; }
public VirusBlob(IGame game, IPhysics physics, IStateTracker stateTracker, Vector position) : base(game, physics, stateTracker, position, game.Settings.VirusMinMass) { _physics = physics; _fed = 0; MakeDynamic(); }
public VisualizationConnection(IAdminCommandFactory adminCommandFactory, IStateTracker stateTracker, IGame game) { _adminCommandFactory = adminCommandFactory; _stateTracker = stateTracker; _game = game; _dataToSend = new BufferBlock <string>(); _pushDataState = PushDataState.None; }
public AdminConnection(IAdminCommandFactory adminCommandFactory, IStateTracker stateTracker, IGame game) { _adminCommandFactory = adminCommandFactory; _stateTracker = stateTracker; _game = game; _dataToSend = new BufferBlock<string>(); _pushDataState = PushDataState.None; }
public PlayerBlob(Player owner, IGame game, IPhysics physics, IStateTracker stateTracker, Vector position, bool controlledByPlayer) : base(game, physics, stateTracker, position, game.Settings.MinPlayerBlobMass) { _physics = physics; Owner = owner; RecombineTicks = game.TickCount; ControlledByPlayer = controlledByPlayer; Mass = Game.Settings.MinPlayerBlobMass; MakeDynamic(); }
public ClassicGameMode(IGame game, IPhysics physics, IStateTracker stateTracker, IPlayerRepository playerRepository) { _playerRepository = playerRepository; _entitiesSpawners = new List <EntitiesSpawner> { new FoodSpawner(game, physics, stateTracker), new VirusSpawner(game, physics, stateTracker) }; _playerStats = new List <PlayerStat>(); }
public ConnectionFactory( IAdminCommandFactory adminCommandFactory, IPlayerCommandFactory playerCommandFactory, IPlayerRepository playerRepository, IStateTracker stateTracker, IGame game) { _adminCommandFactory = adminCommandFactory; _playerCommandFactory = playerCommandFactory; _playerRepository = playerRepository; _stateTracker = stateTracker; _game = game; }
public Game(IRandom random, IPhysics physics, IStateTracker stateTracker, IPlayerRepository playerRepository, IClock clock) { _physics = physics; _stateTracker = stateTracker; _playerRepository = playerRepository; _clock = clock; Random = random; _blobs = new List<Blob>(); Settings = new WorldSettings(); GameMode = new ClassicGameMode(this, physics, stateTracker, playerRepository); Stop(); }
public Game(IRandom random, IPhysics physics, IStateTracker stateTracker, IPlayerRepository playerRepository, IClock clock) { _physics = physics; _stateTracker = stateTracker; _playerRepository = playerRepository; _clock = clock; Random = random; _blobs = new List <Blob>(); Settings = new WorldSettings(); GameMode = new ClassicGameMode(this, physics, stateTracker, playerRepository); Stop(); }
protected Blob(IGame game, IPhysics physics, IStateTracker stateTracker, Vector position, float mass) { _physics = physics; Game = game; StateTracker = stateTracker; Position = position; Mass = mass; IsStatic = false; _isCreated = false; Id = BlobIdProvider.GetId(); }
// Start is called before the first frame update void Start() { if (follower == null) { follower = transform.parent.gameObject; } if (parentHasStateMachine) { stateMachine = transform.parent.gameObject.GetComponent <IStateTracker>(); } timer = gameObject.AddComponent <Timer>(); timer.SetTimer(followDuration, Timer.Status.IDLE); Tween.Spline(splineToFollow, follower.transform, startPosition, endPosition, false, followDuration, followDelay, Tween.EaseInOut); timer.StartTimer(); finishedFollowing = false; }
public EjectedMassBlob(IGame game, IPhysics physics, IStateTracker stateTracker, Vector position) : base(game, physics, stateTracker, position) { MakeDynamic(); }
private void LogGameStatus(IStateTracker stateTracker) { Log($"Game Status : {stateTracker.GetGameStatus()}"); }
public FoodSpawner(IGame game, IPhysics physics, IStateTracker stateTracker) : base(game, physics) { _stateTracker = stateTracker; }
public FoodBlob(IGame game, IPhysics physics, IStateTracker stateTracker, Vector position) : base(game, physics, stateTracker, position, game.Settings.FoodMass) { MakeStatic(); }
public AdminCommandFactory(IPhysics physics, IStateTracker stateTracker, IPlayerRepository playerRepository) { _physics = physics; _stateTracker = stateTracker; _playerRepository = playerRepository; }
public VirusSpawner(IGame game, IPhysics physics, IStateTracker stateTracker) : base(game, physics) { _stateTracker = stateTracker; }