Beispiel #1
0
        private void CreateNewGamefield()
        {
            _gamefield = null;

            //Creates new GameField each time method is called
            _gamefield = new SymbolDto[ROWS, COLUMNS];
            for (int x = 0; x < ROWS; x++)
            {
                for (int y = 0; y < COLUMNS; y++)
                {
                    //Creates new 2 dimension array of symbol objects
                    _gamefield[x, y] = new SymbolDto(_calculator);
                }
            }
        }
Beispiel #2
0
        public void CreateSymbol(SymbolDto symbol)
        {
            var symbolType = symbol.Type.StartsWith("System.") ? symbol.Type : "System." + symbol.Type;
            var type       = Type.GetType(symbolType);

            if (type != null)
            {
                var adsSymbol = new AdsSymbol(symbol.Name, type);
                server.AddSymbol(adsSymbol);
            }
            else
            {
                throw new Exception($"Unable to find type named {symbolType}");
            }
        }
Beispiel #3
0
 public async Task <OpenPositionDto> GetOpenPositionBySymbolAsync([FromQuery] SymbolDto symbol)
 {
     // TODO Apply here cancellation token and figure out why it needs
     return(await _mediator.Send(new GetOpenPositionBySymbolQuery(symbol)));
 }
 public GetOpenPositionBySymbolQuery(SymbolDto symbol)
 {
     Symbol = symbol;
 }
Beispiel #5
0
 public void CreateSymbol([FromBody] SymbolDto symbol)
 {
     plcService.CreateSymbol(symbol);
 }