Back to project page pink-ponies.
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.
/** * 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() + "]"; } }