internal RealSpaceEngineers(GameSession gameSession, ILog log, PluginConfig config) { var lowLevelObserver = new LowLevelObserver(gameSession) { Log = log }; Observer = new Observer(lowLevelObserver) { Log = log, Radius = config.ObservationRadius }; Session = new SessionController() { Log = log }; Items = new Items(gameSession, lowLevelObserver); Definitions = new Definitions(); var characterController = new CharacterController(gameSession, Observer, lowLevelObserver, log); Character = characterController; var blocks = new Blocks(gameSession, lowLevelObserver); Blocks = blocks; Admin = new SpaceEngineersAdmin(characterController, blocks, new ObserverAdmin(lowLevelObserver)); Screens = new Screens(); }
public IBlocks Dequeue() { LastBlock = BlocksFactory.Create(); Queue.Enqueue(LastBlock); return(Queue.Dequeue()); }
public void SetUp() { Board = new Board(10, 20); Board.AddPlayerCount(); IBlocks = new IShapedBlocks(); LBlocks = new LShapedBlocks(); }
public PerPool(IPoolConfig poolConfig, IDaemonClient daemonClient,IMinerManager minerManager, IHashAlgorithm hashAlgorithm, IBlocks blockStatistics, IStorage storage) { Config = poolConfig; _daemonClient = daemonClient; _minerManager = minerManager; Blocks = blockStatistics; _storage = storage; _response = new ExpandoObject(); _shareMultiplier = Math.Pow(2, 32) / hashAlgorithm.Multiplier; }
public void SetUp() { var mockBoard = new Mock <IBoard>(); mockBoard.Setup(m => m.Width).Returns(10); mockBoard.Setup(m => m.Height).Returns(20); mockBoard.Setup(m => m.ExistPosition(8, 0)).Returns(true); mockBoard.Setup(m => m.ExistPosition(2, 0)).Returns(true); CollisionDetection = new CollisionDetection(mockBoard.Object); IBlocks = new IShapedBlocks(); LBlocks = new LShapedBlocks(); }
public bool Equals(IBlocks blocks) { if (BlockList.Count != blocks.BlockList.Count) { return(false); } var result = true; for (var i = 0; i < BlockList.Count; i++) { if (!BlockList[i].Equals(blocks.BlockList[i])) { result = false; } } return(result); }
public void SetUp() { var mockBoard = new Mock <IBoard>(); mockBoard.Setup(m => m.Width).Returns(10); mockBoard.Setup(m => m.ExistPosition(9, 0)).Returns(true); mockBoard.Setup(m => m.ExistPosition(7, 0)).Returns(true); mockBoard.Setup(m => m.ExistPosition(0, 0)).Returns(true); var collisionDetection = new CollisionDetection(mockBoard.Object); var mockControlBlocksPresenter = new Mock <IControlBlocksPresenter>(); var adjuster = new ControlBlocksAdjuster(collisionDetection, mockControlBlocksPresenter.Object); MoveLeftService = new MoveLeftControlBlocksService(collisionDetection, mockControlBlocksPresenter.Object); MoveRightService = new MoveRightControlBlocksService(collisionDetection, mockControlBlocksPresenter.Object); SpinRightService = new SpinRightControlBlocksService(adjuster); SpinLeftService = new SpinLeftControlBlocksService(adjuster); IBlocks = new IShapedBlocks(); }
public void DrawQueueBlocks(IBlocks blocks) { var index = QueueBlocks.Count; var blockObjects = new List <BlockView>(); foreach (var block in blocks.BlockList) { var newPosition = transform.position; newPosition.x += block.X; newPosition.y -= index * IntervalY - block.Y; var blockObject = BlockViewFactory.InstantiateBlock( block.BlockColor, newPosition, transform ); blockObjects.Add(blockObject); } QueueBlocks.Enqueue(blockObjects); }
public void DrawQueueBlocksDequeue(IBlocks nextBlocks) { BlocksQueueView.DeleteTopBlocks(); BlocksQueueView.SqueezeEmptyPosition(); BlocksQueueView.DrawQueueBlocks(nextBlocks); }
public BlocksOnGameLoop(IBlocks blocks, FuncActionDispatcher funcActionDispatcher) : base(funcActionDispatcher) { m_blocks = blocks; }
public BoardRenderer(IBlocks <IBlock> blocks, int blockSize) : base(blocks, blockSize) { }
public GraphicsRenderer(IBlocks <IBlock> blocks, int blockSize) { _blocks = blocks; BlockSize = blockSize; }
public IPerPool GetPerPoolStats(IPoolConfig poolConfig, IDaemonClient daemonClient, IMinerManager minerManager, IHashAlgorithm hashAlgorithm, IBlocks blockStatistics, IStorage storage) { var @params = new NamedParameterOverloads { {"poolConfig", poolConfig}, {"daemonClient", daemonClient}, {"minerManager",minerManager}, {"hashAlgorithm", hashAlgorithm}, {"blockStatistics", blockStatistics}, {"storage", storage}, }; return _applicationContext.Container.Resolve<IPerPool>(@params); }
public void RightSpin() { Blocks = Blocks.RightSpin(); }
public void LeftSpin() { Blocks = Blocks.LeftSpin(); }
public ControlBlocks(int x, int y, IBlocks blocks) { X = x; Y = y; Blocks = blocks; }
public void SetUp() { IBlocks = new IShapedBlocks(); }