Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
MapleParty.java
Package: src.rar [view]
Upload User: gwt600
Upload Date: 2021-06-03
Package Size: 704k
Code Size: 5k
Category:
Games
Development Platform:
Java
- /*
- This file is part of the OdinMS Maple Story Server
- Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
- Matthias Butz <matze@odinms.de>
- Jan Christian Meyer <vimes@odinms.de>
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License version 3
- as published by the Free Software Foundation. You may not use, modify
- or distribute this program under any other version of the
- GNU Affero General Public License.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
- package net.sf.odinms.net.world;
- import java.io.Serializable;
- import java.util.Collection;
- import java.util.Collections;
- import java.util.LinkedList;
- import java.util.List;
- public class MapleParty implements Serializable {
- private static final long serialVersionUID = 9179541993413738569L;
- private MaplePartyCharacter leader;
- private List<MaplePartyCharacter> members = new LinkedList<MaplePartyCharacter>();
- private int id;
- private int CP;
- private int team;
- private int totalCP;
- private boolean capture = false;
- private boolean waiting = false;
- private MapleParty enemy = null;
- private boolean challenging = false;
- private boolean challenged = false;
- private MapleParty challenger = null;
- private int points = 0;
- public MapleParty(int id, MaplePartyCharacter chrfor) {
- this.leader = chrfor;
- this.members.add(this.leader);
- this.id = id;
- }
- public boolean getCapture() {
- return capture;
- }
- public boolean getWaiting() {
- return waiting;
- }
- public boolean getChallenging() {
- return challenging;
- }
- public boolean getChallenged() {
- return challenged;
- }
- public MapleParty getChallenger() {
- return challenger;
- }
- public int getPoints() {
- return points;
- }
- public void setCapture(boolean c) {
- this.capture = c;
- }
- public void setWaiting(boolean c) {
- this.waiting = c;
- }
- public void setChallenging(boolean c) {
- this.challenging = c;
- }
- public void setChallenged(boolean c) {
- this.challenged = c;
- }
- public void setEnemy(MapleParty enemy) {
- this.enemy = enemy;
- }
- public void setChallenger(MapleParty c) {
- this.challenger = c;
- }
- public void setPoints(int c) {
- this.points = c;
- }
- public boolean containsMembers(MaplePartyCharacter member) {
- return members.contains(member);
- }
- public void setLeader(MaplePartyCharacter victim) {
- this.leader = victim;
- }
- public void addMember(MaplePartyCharacter member) {
- members.add(member);
- }
- public void removeMember(MaplePartyCharacter member) {
- members.remove(member);
- }
- public void updateMember(MaplePartyCharacter member) {
- for (int i = 0; i < members.size(); i++) {
- MaplePartyCharacter chr = members.get(i);
- if (chr.equals(member)) {
- members.set(i, member);
- }
- }
- }
- public MaplePartyCharacter getMemberById(int id) {
- for (MaplePartyCharacter chr : members) {
- if (chr.getId() == id) {
- return chr;
- }
- }
- return null;
- }
- public Collection<MaplePartyCharacter> getMembers() {
- return Collections.unmodifiableList(members);
- }
- public int getId() {
- return id;
- }
- public void setId(int id) {
- this.id = id;
- }
- public int getCP() {
- return this.CP;
- }
- public int getTeam() {
- return this.team;
- }
- public int getTotalCP() {
- return this.totalCP;
- }
- public void setCP(int cp) {
- this.CP = cp;
- }
- public void setTeam(int team) {
- this.team = team;
- }
- public void setTotalCP(int totalcp) {
- this.totalCP = totalcp;
- }
- public MaplePartyCharacter getLeader() {
- return leader;
- }
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + id;
- return result;
- }
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- final MapleParty other = (MapleParty) obj;
- if (id != other.id) {
- return false;
- }
- return true;
- }
- }