示例#1
0
        public IFigureEntity Create(IFigureDef figureDef, GameTeam team)
        {
            var figureEntity = FigureCreator.Create(figureDef, team);

            var figureView = FigureViewFactory.Spawn(figureEntity);

            FigureViewModel.AddView(figureEntity, figureView);

            return(figureEntity);
        }
示例#2
0
        private void TransformFigure(IFigureEntity figure, IFigureDef figureDef)
        {
            var cell = figure.PlacedCell;
            var team = figure.Team;

            FigureController.RemoveFigure(figure);

            var newTransformFigure = FigureCreator.Create(figureDef, team);

            FigureController.MoveFigure(newTransformFigure, cell);
        }
示例#3
0
        private void ArrangementFigures(IGameDef gameDef)
        {
            foreach (var startInfoFigureDef in gameDef.StartInfoFigureDefs)
            {
                var figureDef    = startInfoFigureDef.Def;
                var team         = startInfoFigureDef.Team;
                var figureEntity = FigureCreator.Create(figureDef, team);

                var cell = BoardModel.GetCell(startInfoFigureDef.StartCol, startInfoFigureDef.StartRow);
                FigureController.MoveFigure(figureEntity, cell);
            }
        }