Ejemplo n.º 1
0
        /// <summary>
        /// Define a language role with a given name and description
        /// </summary>
        /// <param name="roleName">The role name</param>
        /// <param name="roleSecription">The role description</param>
        /// <param name="enableQual">A flag for full symbol qualification of the role</param>
        /// <returns></returns>
        public LanguageRole DefineLanguageRole(string roleName, string roleSecription, bool enableQual)
        {
            if (RoleDictionary.ContainsKey(roleName))
            {
                return(RoleDictionary[roleName]);
            }

            var newRole = new LanguageRole(roleName, roleSecription, enableQual);

            RoleDictionary.Add(roleName, newRole);

            return(newRole);
        }
Ejemplo n.º 2
0
        public void AddRole(RoleActor role)
        {
            if (role.HostMapCell == this)
            {
                return;
            }

            if (role.HostMapCell != null)
            {
                role.HostMapCell.RemoveRole(role);
            }

            if (!RoleDictionary.ContainsKey(role.Id))
            {
                RoleDictionary[role.Id] = role;

                if (role is PlayerInstance)
                {
                    Players.Add(role as PlayerInstance);
                }
                else
                {
                    switch (role.GameType)
                    {
                    case eActorGameType.Npc:
                        NPCs.Add(role as NPCInstance);
                        break;

                    case eActorGameType.PlayerImage:
                        Images.Add(role as PlayerImage);
                        break;

//                         case CSCommon.Component.eActorGameType.EffectNpc:
//                             EffectNpcs.Add(role);
//                             break;
                    //case CSCommon.Component.eActorGameType.DropedItem:
                    //    DropedItems.Add(role as DropedItem.DropedItemRole);
                    //    break;
//                         case CSCommon.Component.eActorGameType.GatherItem:
//                             GatherItems.Add(role as Gather.GatherItem);
//                             break;
                    default:
                        break;
                    }
                }

                role.HostMapCell = this;
            }
        }