Package games.stendhal.server.maps.deathmatch

Source Code of games.stendhal.server.maps.deathmatch.StartAction

/* $Id: StartAction.java,v 1.23 2011/05/01 19:50:08 martinfuchs Exp $ */
/***************************************************************************
*                   (C) Copyright 2003-2010 - Stendhal                    *
***************************************************************************
***************************************************************************
*                                                                         *
*   This program is free software; you can redistribute it and/or modify  *
*   it under the terms of the GNU General Public License as published by  *
*   the Free Software Foundation; either version 2 of the License, or     *
*   (at your option) any later version.                                   *
*                                                                         *
***************************************************************************/
package games.stendhal.server.maps.deathmatch;

import games.stendhal.common.parser.Sentence;
import games.stendhal.server.entity.npc.ChatAction;
import games.stendhal.server.entity.npc.EventRaiser;
import games.stendhal.server.entity.npc.action.IncrementQuestAction;
import games.stendhal.server.entity.player.Player;

/**
* Action to start a new deathmatch session for the player.
*
* @author hendrik
*/
public class StartAction implements ChatAction {

  private final DeathmatchInfo deathmatchInfo;

  /**
   * Creates a new StartAction for the specified deathmatch.
  
   * @param deathmatchInfo deathmatch to start
   */
  public StartAction(final DeathmatchInfo deathmatchInfo) {
    this.deathmatchInfo = deathmatchInfo;
  }

  public void fire(final Player player, final Sentence sentence, final EventRaiser raiser) {
    raiser.say("Have fun!");
    // Track starts. The three first numbers are reserved for level,
    // time stamp and points (first is the state)
    new IncrementQuestAction("deathmatch", 5, 1).fire(player, sentence, raiser);
    deathmatchInfo.startSession(player, raiser);
  }
}
TOP

Related Classes of games.stendhal.server.maps.deathmatch.StartAction

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.