Ejemplo n.º 1
0
        public override void InitModelView(ModelBase model, ViewBase view)
        {
            base.InitModelView(model, view);

            SoldierView soldierView = (SoldierView)view;

            soldierView.ArrivedToWaypoint += OnArrivedToWaypoint;
        }
Ejemplo n.º 2
0
        private void OnArrivedToWaypoint(SoldierView sender, int coordX, int coordY)
        {
            SoldierModel model = (SoldierModel)_viewToModel[sender];

            GridManager.Instance.UpdateMap(model.CoordX, model.CoordY, 1, 1, 0);

            model.CoordX = coordX;
            model.CoordY = coordY;

            GridManager.Instance.UpdateMap(coordX, coordY, 1, 1, GridLayers.Units);

            model.RemovePath(new Vector2(coordX, coordY));
        }