테스트

aion-server 4.8

Gitteol
최고관리자 · 1 · 💬 0 클론/새로받기
 4.8 61f661d · 1 commits 새로받기(Pull)
game-server/src/com/aionemu/gameserver/geoEngine/collision/CollisionIntention.java
package com.aionemu.gameserver.geoEngine.collision;

import java.util.EnumSet;
import java.util.Set;

/**
 * @author Rolandas
 */
public enum CollisionIntention {
	NONE(0),
	PHYSICAL(1 << 0), // Physical collision
	MATERIAL(1 << 1), // Mesh materials with skills
	SKILL(1 << 2), // Skill obstacles
	WALK(1 << 3), // Walk/NoWalk obstacles
	DOOR(1 << 4), // Doors which have a state opened/closed
	EVENT(1 << 5), // Appear on event only
	MOVEABLE(1 << 6), // Ships, shugo boxes
	PHYSICAL_SEE_THROUGH(1 << 7),
	DEFAULT_COLLISIONS(PHYSICAL.getId() | DOOR.getId() | PHYSICAL_SEE_THROUGH.getId()),
	CANT_SEE_COLLISIONS(PHYSICAL.getId() | DOOR.getId()),
	// This is used for nodes only, means they allow to enumerate their child geometries
	// Nodes which do not specify it won't let their children enumerated for collisions,
	// to speed up processing
	ALL(PHYSICAL.getId() | MATERIAL.getId() | SKILL.getId() | WALK.getId() | DOOR.getId()
			| EVENT.getId() | MOVEABLE.getId() | PHYSICAL_SEE_THROUGH.getId());

	private byte id;

	private CollisionIntention(int id) {
		this.id = (byte) id;
	}

	public byte getId() {
		return id;
	}

	public static Set<CollisionIntention> getFlagsFromValue(int value) {
		EnumSet<CollisionIntention> result = EnumSet.noneOf(CollisionIntention.class);
		for (CollisionIntention m : CollisionIntention.values()) {
			if ((value & m.getId()) == m.getId()) {
				if (m == NONE || m == ALL)
					continue;
				result.add(m);
			}
		}
		return result;
	}

	public static String toString(int value) {
		String str = "";
		for (CollisionIntention m : CollisionIntention.values()) {
			if (m == NONE || m == ALL)
				continue;
			if ((value & m.getId()) == m.getId()) {
				str += m.toString();
				str += ", ";
			}
		}
		if (str.length() > 0)
			str = str.substring(0, str.length() - 2);
		return str;
	}
}

📎 첨부파일

댓글 작성 권한이 없습니다.
🏆 포인트 랭킹 TOP 10
순위 닉네임 포인트
1 no_profile 타키야겐지쪽지보내기 자기소개 아이디로 검색 전체게시물 102,949
2 no_profile 동가리쪽지보내기 자기소개 아이디로 검색 전체게시물 63,733
3 no_profile 라프텔쪽지보내기 자기소개 아이디로 검색 전체게시물 51,771
4 no_profile 불멸의행복쪽지보내기 자기소개 아이디로 검색 전체게시물 36,923
5 서번트쪽지보내기 자기소개 아이디로 검색 전체게시물 35,011
6 no_profile 닥터스쪽지보내기 자기소개 아이디로 검색 전체게시물 29,470
7 no_profile 검은고양이쪽지보내기 자기소개 아이디로 검색 전체게시물 29,077
8 no_profile Revolution쪽지보내기 자기소개 아이디로 검색 전체게시물 28,199
9 no_profile 보거스쪽지보내기 자기소개 아이디로 검색 전체게시물 26,731
10 no_profile 호롤롤로쪽지보내기 자기소개 아이디로 검색 전체게시물 17,020
알림 0