Android Open Source - pink-ponies Player






From Project

Back to project page pink-ponies.

License

The source code is released under:

Software License Agreement (BSD License) Copyright (c) 2013, Pink Ponies Team All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted prov...

If you think the Android project pink-ponies listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/**
 * Copyright (c) 2013 Alexander Konovalov, Andrey Konovalov, Sergey Voronov, Vitaly Malyshev. All
 * rights reserved. Use of this source code is governed by a BSD-style license that can be found in
 * the LICENSE file./*from   www  .  ja  v a  2s. c  o m*/
 */

package ru.pinkponies.server;

import java.nio.channels.SocketChannel;

import ru.pinkponies.protocol.Location;

public final class Player extends Entity {
  private static final String DEFAULT_NAME = "UNKNOWN";
  private final SocketChannel channel;
  private Quest quest;
  private String name;

  public Player(final long id, final Location location, final SocketChannel channel) {
    super(id, location);
    this.channel = channel;
    this.quest = null;
    this.name = Player.DEFAULT_NAME;
  }

  public void setName(final String playerName) {
    this.name = playerName;
  }

  public String getName() {
    return this.name;
  }

  public boolean isLoggedIn() {
    return this.name != Player.DEFAULT_NAME;
  }

  public SocketChannel getChannel() {
    return this.channel;
  }

  public Quest getQuest() {
    return this.quest;
  }

  public void setQuest(final Quest quest) {
    this.quest = quest;
  }

  @Override
  public String toString() {
    return "Player [id=" + this.getId() + ", " + this.getLocation() + "]";
  }
}




Java Source Code List

android.UnusedStub.java
ru.pinkponies.app.LoginActivity.java
ru.pinkponies.app.MainActivity.java
ru.pinkponies.app.MapOverlay.java
ru.pinkponies.app.net.NetworkListener.java
ru.pinkponies.app.net.NetworkingService.java
ru.pinkponies.app.net.NetworkingThread.java
ru.pinkponies.app.net.package-info.java
ru.pinkponies.app.package-info.java
ru.pinkponies.protocol.AppleUpdatePacket.java
ru.pinkponies.protocol.ClientOptionsPacket.java
ru.pinkponies.protocol.Location.java
ru.pinkponies.protocol.LoginPacket.java
ru.pinkponies.protocol.Packet.java
ru.pinkponies.protocol.PlayerUpdatePacket.java
ru.pinkponies.protocol.Protocol.java
ru.pinkponies.protocol.QuestActionPacket.java
ru.pinkponies.protocol.QuestUpdatePacket.java
ru.pinkponies.protocol.SayPacket.java
ru.pinkponies.protocol.package-info.java
ru.pinkponies.server.Apple.java
ru.pinkponies.server.Entity.java
ru.pinkponies.server.IdManager.java
ru.pinkponies.server.Player.java
ru.pinkponies.server.Quest.java
ru.pinkponies.server.Server.java
ru.pinkponies.server.package-info.java