Example #1
0
        public static RoomUser GetDeployedBotById(int BotsID)
        {
            RoomUser DeployedBot = null;

            if (RoleplayBotManager.DeployedRoleplayBots == null)
            {
                return(null);
            }
            if (RoleplayBotManager.DeployedRoleplayBots.Count <= 0)
            {
                return(null);
            }

            foreach (RoomUser DeployedBots in RoleplayBotManager.DeployedRoleplayBots.Values)
            {
                if (DeployedBots == null)
                {
                    continue;
                }
                if (DeployedBots.GetBotRoleplay() == null)
                {
                    continue;
                }
                if (DeployedBots.GetBotRoleplay().Id != BotsID)
                {
                    continue;
                }

                DeployedBot = DeployedBots;
            }

            return(DeployedBot);
        }
Example #2
0
        public static RoomUser GetDeployedBotByName(string BotsName)
        {
            RoomUser DeployedBot = null;

            foreach (RoomUser DeployedBots in RoleplayBotManager.DeployedRoleplayBots.Values)
            {
                if (DeployedBots == null)
                {
                    continue;
                }
                if (DeployedBots.GetBotRoleplay() == null)
                {
                    continue;
                }
                if (DeployedBots.GetBotRoleplay().Name.ToLower() != BotsName.ToLower())
                {
                    continue;
                }

                DeployedBot = DeployedBots;
            }

            return(DeployedBot);
        }