コード例 #1
0
ファイル: Game.cs プロジェクト: erin100280/Zelda.NET
 /// <summary>
 /// 
 /// </summary>
 /// <param name="eventManager"></param>
 public Game(EventManager eventManager)
 {
     this.gameStatus = GameStatus.Preparing;
     this.eventManager = eventManager;
     this.players = new ArrayList();
     this.players.Add(new Player(eventManager));
     this.map = new Map(eventManager);
 }
コード例 #2
0
ファイル: GameView.cs プロジェクト: erin100280/Zelda.NET
        /// <summary>
        /// 
        /// </summary>
        public void ShowMap(Map map)
        {
            mapRectangles = new Rectangle[9];
            int x = 10;
            int y = 10;
            int width = 128;
            int height = 128;
            int i = 0;

            if (map == null)
            {
                throw new ArgumentNullException("map");
            }
            foreach (Sector sec in map.GetSectors())
            {
                if (i < 3)
                {
                    mapRectangles[i] = new Rectangle(x, y, width, height);
                    //LogFile.WriteLine(mapRectangles[i].ToString());
                    x += 138;
                }
                else if (i >= 3 && i < 6)
                {
                    if (i == 3)
                    {
                        x = 10;
                    }
                    y = 148;

                    mapRectangles[i] = new Rectangle(x, y, width, height);
                    //LogFile.WriteLine(mapRectangles[i].ToString());
                    x += 138;
                }
                else if (i >= 6)
                {
                    if (i == 6)
                    {
                        x = 10;
                    }
                    y = 286;

                    mapRectangles[i] = new Rectangle(x, y, width, height);
                    //LogFile.WriteLine(mapRectangles[i].ToString());
                    x += 138;
                }
                backSprites.Add(new SectorSprite(Video.Screen, sec, mapRectangles[i]));
                i++;
            }
        }
コード例 #3
0
 /// <summary>
 /// 
 /// </summary>
 public MapBuiltEventArgs(Map map)
 {
     this.map = map;
 }
コード例 #4
0
ファイル: GameView.cs プロジェクト: erin100280/Zelda.NET
 /// <summary>
 /// 
 /// </summary>
 /// <param name="eventManager"></param>
 /// <param name="e"></param>
 void Subscribe(object eventManager, MapBuiltEventArgs e)
 {
     //LogFile.WriteLine("GameView received a MapBuilt event");
     this.map = e.Map;
     ShowMap(this.map);
 }