コード例 #1
0
 public void Visit(ImprovedMapEditorModel model)
 {
     if (model.GetScenario() != context)
     {
         SetScenario(model.GetScenario());
     }
 }
        public MapEditorView()
        {
            InitializeComponent();
            MapEditorModelOld      model     = new MapEditorModelOld();
            ImprovedMapEditorModel goodModel = new ImprovedMapEditorModel();

            this.controller = new MapEditorController(goodModel);
            // TODO Add all other views
            tilePalette.loadImageList();
            tilePalette.setController(controller);
            scenarioView1.setController(controller);
            model.register(tilePalette);
            model.register(scenarioView1);

            // TODO Remove this code, testing purposes only
            this.controller.createNewScenario();
            scenarioView1.SetScenario(goodModel.GetScenario());
            goodModel.RegisterObserver(scenarioView1);
            goodModel.GetScenario().GetGameWorld().NotifyAll();
        }
 public MapEditorController(ImprovedMapEditorModel model)
 {
     this.model         = null;
     this.improvedModel = model;
 }
 public MapEditorController(MapEditorModelOld model)
 {
     this.model         = model;
     this.improvedModel = new ImprovedMapEditorModel();
 }