Пример #1
0
        private void BindPellet(PelletConfig p, GridConfig g)
        {
            while ((p.RowInset << 1) >= g.Rows)
            {
                p.RowInset >>= 1;
            }

            while ((p.ColumnInset << 1) >= g.Columns)
            {
                p.ColumnInset >>= 1;
            }

            var pellet = new Pellet(p.Color, p.RowInset, p.ColumnInset);

            injectionBinder.Bind <IPellet> ().ToValue(pellet).ToSingleton();
        }
Пример #2
0
        private void BindGrid(GridConfig g)
        {
            var grid = new Grid(g.Rows, g.Columns);

            injectionBinder.Bind <IGrid> ().ToValue(grid).ToSingleton();
        }