当前位置: 首页>>代码示例>>Java>>正文


Java CapeManager类代码示例

本文整理汇总了Java中com.jadarstudios.developercapes.cape.CapeManager的典型用法代码示例。如果您正苦于以下问题:Java CapeManager类的具体用法?Java CapeManager怎么用?Java CapeManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


CapeManager类属于com.jadarstudios.developercapes.cape包,在下文中一共展示了CapeManager类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: parse

import com.jadarstudios.developercapes.cape.CapeManager; //导入依赖的package包/类
public Group parse (String name, Map<String, Object> data) {
	Group group = new Group(name);

	Object usersObj = data.get("users");
	Object capeUrlObj = data.get("capeUrl");

	if (!(usersObj instanceof ArrayList) || !(capeUrlObj instanceof String)) {
		DevCapes.logger.error(String.format("Group %s could not be parsed because it either is invalid or missing elements.", name));
		return null;
	}

	ArrayList users = (ArrayList) usersObj;
	String capeUrl = (String) capeUrlObj;

	group.cape = CapeManager.getInstance().parse(name, capeUrl);

	for (Object obj : users) {
		User user = UserManager.getInstance().parse((String) obj, group.cape);
		if (user != null) group.addUser(user);
	}
	return group;
}
 
开发者ID:Wehavecookies56,项目名称:Kingdom-Keys-Re-Coded,代码行数:23,代码来源:GroupManager.java

示例2: parse

import com.jadarstudios.developercapes.cape.CapeManager; //导入依赖的package包/类
public Group parse(String name, Map<String, Object> data) {
    Group group = new Group(name);

    Object usersObj = data.get("users");
    Object capeUrlObj = data.get("capeUrl");

    if (!(usersObj instanceof ArrayList) || !(capeUrlObj instanceof String)) {
        DevCapes.logger.error(String.format("Group %s could not be parsed because it either is invalid or missing elements.", name));
        return null;
    }

    ArrayList users = (ArrayList)usersObj;
    String capeUrl = (String)capeUrlObj;

    group.cape = CapeManager.getInstance().parse(name, capeUrl);

    for (Object obj : users) {
        User user = UserManager.getInstance().parse((String)obj, group.cape);
        if (user != null) {
            group.addUser(user);
        }
    }
    return group;
}
 
开发者ID:ME-Corp,项目名称:SolderCraft,代码行数:25,代码来源:GroupManager.java

示例3: parse

import com.jadarstudios.developercapes.cape.CapeManager; //导入依赖的package包/类
public User parse (String user, Object cape) {
	User userInstance = new User(user);

	ICape capeInstance = (cape instanceof ICape) ? (ICape) cape : CapeManager.getInstance().parse(user, cape.toString());

	if (capeInstance != null)
		userInstance.capes.add(capeInstance);
	else
		DevCapes.logger.error(String.format("Error parsing cape, %s", cape.toString()));

	return userInstance;
}
 
开发者ID:Wehavecookies56,项目名称:Kingdom-Keys-Re-Coded,代码行数:13,代码来源:UserManager.java

示例4: addGroup

import com.jadarstudios.developercapes.cape.CapeManager; //导入依赖的package包/类
public void addGroup (Group group) {
	groups.put(group.name, group);

	try {
		UserManager.getInstance().addUsers(group.users.values());
		CapeManager.getInstance().addCape(group.cape);
	} catch (Exception e) {
		e.printStackTrace();
	}
}
 
开发者ID:Wehavecookies56,项目名称:Kingdom-Keys-Re-Coded,代码行数:11,代码来源:GroupManager.java

示例5: addUser

import com.jadarstudios.developercapes.cape.CapeManager; //导入依赖的package包/类
public void addUser(User user) throws NullPointerException {
    if (user == null || user.username == null || user.username.isEmpty()) {
        throw new NullPointerException("Cannot add a null user!");
    }

    this.users.put(user.username, user);
    CapeManager.getInstance().addCapes(user.capes);
}
 
开发者ID:ME-Corp,项目名称:SolderCraft,代码行数:9,代码来源:UserManager.java

示例6: parse

import com.jadarstudios.developercapes.cape.CapeManager; //导入依赖的package包/类
public User parse(String user, Object cape) {
    User userInstance = new User(user);

    ICape capeInstance = (cape instanceof ICape) ? (ICape)cape : CapeManager.getInstance().parse(user, cape.toString());

    if (capeInstance != null) {
        userInstance.capes.add(capeInstance);
    } else {
        DevCapes.logger.error(String.format("Error parsing cape, %s", cape.toString()));
    }

    return userInstance;
}
 
开发者ID:ME-Corp,项目名称:SolderCraft,代码行数:14,代码来源:UserManager.java

示例7: addGroup

import com.jadarstudios.developercapes.cape.CapeManager; //导入依赖的package包/类
public void addGroup(Group group) {
    groups.put(group.name, group);

    try {
        UserManager.getInstance().addUsers(group.users.values());
        CapeManager.getInstance().addCape(group.cape);
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
开发者ID:ME-Corp,项目名称:SolderCraft,代码行数:11,代码来源:GroupManager.java

示例8: addUser

import com.jadarstudios.developercapes.cape.CapeManager; //导入依赖的package包/类
public void addUser(User user) throws NullPointerException {
    if (user == null || user.username == null || user.username.isEmpty()) {
        DevCapes.logger.error("Cannot add a null user.");
        throw new NullPointerException();
    }

    this.users.put(user.username, user);
    CapeManager.getInstance().addCapes(user.capes);
}
 
开发者ID:Cortex-Modders,项目名称:CodeLyokoMod,代码行数:10,代码来源:UserManager.java

示例9: addGroup

import com.jadarstudios.developercapes.cape.CapeManager; //导入依赖的package包/类
public void addGroup(Group group) {
    groups.put(group.name, group);

    try {
        UserManager.getInstance().addUsers(new HashSet<User>(group.users.values()));
        CapeManager.getInstance().addCape(group.cape);
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
开发者ID:Cortex-Modders,项目名称:CodeLyokoMod,代码行数:11,代码来源:GroupManager.java

示例10: addUser

import com.jadarstudios.developercapes.cape.CapeManager; //导入依赖的package包/类
public void addUser(User user) throws NullPointerException {
    if (user == null || user.userUUID == null || user.userUUID.isEmpty()) {
        throw new NullPointerException("Cannot add a null user!");
    }

    this.users.put(user.userUUID, user);
    CapeManager.getInstance().addCapes(user.capes);
}
 
开发者ID:jadar,项目名称:DeveloperCapes,代码行数:9,代码来源:UserManager.java

示例11: addUser

import com.jadarstudios.developercapes.cape.CapeManager; //导入依赖的package包/类
public void addUser (User user) throws NullPointerException {
	if (user == null || user.userUUID == null || user.userUUID.isEmpty()) throw new NullPointerException("Cannot add a null user!");

	this.users.put(user.userUUID, user);
	CapeManager.getInstance().addCapes(user.capes);
}
 
开发者ID:Wehavecookies56,项目名称:Kingdom-Keys-Re-Coded,代码行数:7,代码来源:UserManager.java


注:本文中的com.jadarstudios.developercapes.cape.CapeManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。