/// <summary> /// Register a new observer /// </summary> /// <param name="obs">Observer object</param> public void register(ZRTSModel.Scenario.Observer obs) { this.observersList.Add(obs); System.Console.Out.WriteLine(obs.GetType().ToString()); // Check if the observer is View observer if (obs.GetType().ToString().Equals("ZRTS.ViewSelect")) { viewSelectObserver = (ZRTSModel.Scenario.ViewSelectObserver) obs; System.Console.Out.WriteLine("Found!!!"); } }
// TODO: Fix this to follow Visitor pattern. Just testing for now. public Bitmap getBitmapImproved(ZRTSModel.Tile tile) { if (tile.GetType() == typeof(Mountain)) { return bitmaps["mountain"]; } else if (tile.GetType() == typeof(Grass)) { return bitmaps["grass"]; } else if (tile.GetType() == typeof(Sand)) { return bitmaps["lightgrass"]; } return null; }
// TODO: Fix this to follow Visitor pattern. Just testing for now. public Bitmap getBitmapImproved(ZRTSModel.Tile tile) { if (tile.GetType() == typeof(Mountain)) { return new Bitmap(TILES_DIRECTORY + "mountain.png"); } else if (tile.GetType() == typeof(Grass)) { return new Bitmap(TILES_DIRECTORY + "grass.png"); } else if (tile.GetType() == typeof(Sand)) { return new Bitmap(TILES_DIRECTORY + "lightgrass.png"); } return null; }