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();
        }
Exemplo n.º 2
0
    public IBlocks Dequeue()
    {
        LastBlock = BlocksFactory.Create();
        Queue.Enqueue(LastBlock);

        return(Queue.Dequeue());
    }
Exemplo n.º 3
0
        public void SetUp()
        {
            Board = new Board(10, 20);
            Board.AddPlayerCount();

            IBlocks = new IShapedBlocks();

            LBlocks = new LShapedBlocks();
        }
Exemplo n.º 4
0
        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;
        }
Exemplo n.º 5
0
        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();
        }
Exemplo n.º 6
0
    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();
        }
Exemplo n.º 8
0
    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);
    }
Exemplo n.º 9
0
 public void DrawQueueBlocksDequeue(IBlocks nextBlocks)
 {
     BlocksQueueView.DeleteTopBlocks();
     BlocksQueueView.SqueezeEmptyPosition();
     BlocksQueueView.DrawQueueBlocks(nextBlocks);
 }
Exemplo n.º 10
0
 public BlocksOnGameLoop(IBlocks blocks, FuncActionDispatcher funcActionDispatcher) : base(funcActionDispatcher)
 {
     m_blocks = blocks;
 }
Exemplo n.º 11
0
 public BoardRenderer(IBlocks <IBlock> blocks, int blockSize) : base(blocks, blockSize)
 {
 }
Exemplo n.º 12
0
 public GraphicsRenderer(IBlocks <IBlock> blocks, int blockSize)
 {
     _blocks   = blocks;
     BlockSize = blockSize;
 }
Exemplo n.º 13
0
        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);
        }
Exemplo n.º 14
0
 public void RightSpin()
 {
     Blocks = Blocks.RightSpin();
 }
Exemplo n.º 15
0
 public void LeftSpin()
 {
     Blocks = Blocks.LeftSpin();
 }
Exemplo n.º 16
0
 public ControlBlocks(int x, int y, IBlocks blocks)
 {
     X      = x;
     Y      = y;
     Blocks = blocks;
 }
Exemplo n.º 17
0
 public void SetUp()
 {
     IBlocks = new IShapedBlocks();
 }