public IShopUnitModel Create(int id, Transform shopUnitParent) { var unitModel = _shopUnitModelFactory.Create(id); var view = _shopViewFactory.Instantiate(shopUnitParent); _shopUnitControllerFactory.Create(unitModel, view); return(unitModel); }
public IPreparationUnitModel Create(IShopUnitModel shopUnit) { var model = _preparationUnitModelFactory.Create(shopUnit.Id.Value); model.MoveTo(false, _benchModel.GetFirstFreePosition()); var view = _preparationUnitViewFactory.Instantiate(); _preparationUnitControllerFactory.Create(model, view); return(model); }
// TODO move this into creation helper class private void CreateBoard(Vector2Int boardSize) { for (var i = 0; i < boardSize.x; i++) { _fields.Add(i, new Dictionary <int, FieldView>(boardSize.y)); for (var j = 0; j < boardSize.y; j++) { var view = _fieldViewFactory.Instantiate(_boardView.BoardParent); view.Position = new Vector3(i - boardSize.x / 2.0f, 0, j); _fields[i].Add(j, view); } } }