Skip to content

Commit

Permalink
stub in TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
xiongchiamiov committed Oct 7, 2011
1 parent ba4e71e commit 8c81d43
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion Mahjongg2D.java
Expand Up @@ -164,11 +164,26 @@ private void layoutMenus()
mnuItems[0].addActionListener(this);
mnuGame.add(mnuItems[0]);

mnuItems[1] = new JMenuItem("New Game");
mnuItems[1].setAccelerator(KeyStroke.getKeyStroke('N', ActionEvent.ALT_MASK));
mnuItems[1].addActionListener(this);
mnuGame.add(mnuItems[1]);

mnuItems[2] = new JMenuItem("Hint");
mnuItems[2].setAccelerator(KeyStroke.getKeyStroke('H', ActionEvent.ALT_MASK));
mnuItems[2].addActionListener(this);
mnuGame.add(mnuItems[2]);

mnuItems[3] = new JMenuItem("Cheat");
mnuItems[3].setAccelerator(KeyStroke.getKeyStroke('C', ActionEvent.ALT_MASK));
mnuItems[3].addActionListener(this);
mnuGame.add(mnuItems[3]);

mnuItems[4] = new JMenuItem("Quit");
mnuItems[4].setAccelerator(KeyStroke.getKeyStroke('Q', ActionEvent.ALT_MASK));
mnuItems[4].addActionListener(this);
mnuGame.add(mnuItems[4]);

setJMenuBar(menuBar); // tell the frame which menu bar to use
}

Expand Down Expand Up @@ -270,7 +285,15 @@ public void actionPerformed(ActionEvent e)
// Does the user want to restart the current game?
if ("Restart".equals(e.getActionCommand()))
{
// call restart method
// TODO
}
else if ("New Game".equals(e.getActionCommand()))
{
// TODO
}
else if ("Hint".equals(e.getActionCommand()))
{
// TODO
}
else if ("Cheat".equals(e.getActionCommand()))
{
Expand All @@ -280,6 +303,10 @@ else if ("Cheat".equals(e.getActionCommand()))
this.tileCount = 2;
updateStatusBar();
}
else if ("Quit".equals(e.getActionCommand()))
{
// TODO
}
repaint();
}

Expand Down

0 comments on commit 8c81d43

Please sign in to comment.