Ejemplo n.º 1
0
 public void NotifyChanged(ModelData data, Event e)
 {
     _playerPosition = data.PlayerPosition;
     _wallPositions = data.WallPositions;
     _paperPosition = data.PaperPosition;
     _data = data;
     Draw();
 }
Ejemplo n.º 2
0
        public void DrawInfo(ModelData data)
        {
            var textBlock = new TextBlock
            {
                Text = "Lives: " + data.Lives + "  Pages Remaining: " + data.PagesRemaining,
                Foreground = new SolidColorBrush(Colors.White),
                FontSize = _blockSize/4
            };

            Canvas.SetLeft(textBlock, _blockSize/4);

            Canvas.SetTop(textBlock, _blockSize/4);

            _canvas.Children.Add(textBlock);
            /*
            var rect = new Rectangle
            {
                Fill = Brushes.Tomato,
                Width = _blockSize * Room.UnitWidth,
                Height = _blockSize * Room.UnitHeight
            };
            _canvas.Children.Add(rect);*/
        }
Ejemplo n.º 3
0
 public void NotifyObserver(Event e)
 {
     foreach (IModelObserver o in _observers)
     {
         var data = new ModelData(GetPlayerPosition(), GetWallPositions(),
             (Room.PaperFound) ? new Point(-1, -1) : GetPaperPosition(), Player.NumLife, _pagesRemaining);
         o.NotifyChanged(data, e);
     }
 }
Ejemplo n.º 4
0
 public void NotifyChanged(ModelData data, Event e)
 {
     Event = e;
     Draw();
 }