Esempio n. 1
0
 /// <summary>
 /// Set Listtype
 /// </summary>
 /// <param name="value"></param>
 public void setListType(listType value)
 {
     if (value >= listType.UL && value <= listType.DIR)
     {
         _listType = value;
     }
 }
Esempio n. 2
0
        /*  oma_buddylist (not explicitly used in RCS)
         *      -->rcs
         *      -->oma_pocbuddylist
         *      -->list-c
         *      -->list-d
         *  oma_grantedcontacts
         *      -->rcs
         *      -->oma_buddylist
         *  oma_blockedcontacts
         *      -->rcs_blockedcontacts
         *      -->rcs_revokedcontacts
         *  rcs
         *      -->me       (RCS 2)
         *      -->Default
         *      -->list-a
         *      -->list-b
         */
        private listType[] GetRCSLists()
        {
            listType[] rcsLists; // Do not cache

            rcsLists = new listType[3] {
                new listType(), new listType(), new listType()
            };

            /*==  rcs ==*/
            rcsLists[0].displayname       = new displaynameType();
            rcsLists[0].name              = SpecialNames.SHARED_RCS;
            rcsLists[0].displayname.Value = "All Contacts";
            rcsLists[0].ExternalTypes.Add(this.GetResourceListAnchorAsExternalType(SpecialNames.SHARED_DOUBANGO));
            /* rcs 2: The RCS presentity is always part of this list, refer to § 11.4 */
            entryType me = new entryType();

            me.uri = this.xcapStack.XUI;
            rcsLists[0].EntryTypes.Add(me);

            /*==  rcs_blockedcontacts ==*/
            rcsLists[1].displayname       = new displaynameType();
            rcsLists[1].name              = SpecialNames.SHARED_RCS_BLOCKEDCONTACTS;
            rcsLists[1].displayname.Value = "Blocked Contacts";

            /*==  rcs_revokedcontacts ==*/
            rcsLists[2].displayname       = new displaynameType();
            rcsLists[2].name              = SpecialNames.SHARED_RCS_REVOKEDCONTACTS;
            rcsLists[2].displayname.Value = "Revoked Contacts";


            return(rcsLists);
        }
Esempio n. 3
0
        private void GetGroupContact(listType listGroup, ContactItem contctParent)
        {
            IContactService cntService = this.serviceManager.ContactService;
            Group           group      = null;

            if (listGroup != null && listGroup.name != null)
            {
                string strGroupDisName = listGroup.name;
                if (listGroup.displayname != null)
                {
                    strGroupDisName = listGroup.displayname.Value;
                }
                string strUil = UriUtils.GetValidSipUri(listGroup.name);
                group = new Group(listGroup.name, strGroupDisName, strUil, false, contctParent);
                cntService.AddGroup(group, contctParent);
                foreach (entryType entry in listGroup.EntryTypes)
                {
                    Person psContact = this.EntryToContact(entry, group);
                    cntService.AddPerson2Group(group, psContact);
                }
            }
            foreach (listType list in listGroup.ListTypeLists)
            {
                if (list != null && list.name != null)
                {
                    if (group != null)
                    {
                        this.GetGroupContact(list, group);
                    }
                }
            }
        }
Esempio n. 4
0
        public static List <string> txtToList(listType x)
        {
            List <string> empty = new List <string>();

            switch (x)
            {
            case listType.Location:
                return(File.ReadAllLines("locations.txt").ToList());

            case listType.Enemy:
                return(File.ReadAllLines("enemies.txt").ToList());

            case listType.Medicine:
                return(File.ReadAllLines("meds.txt").ToList());

            case listType.Character:
                return(File.ReadAllLines("players.txt").ToList());

            case listType.Transport:
                return(File.ReadAllLines("transport.txt").ToList());

            case listType.Weapon:
                return(File.ReadAllLines("weapons.txt").ToList());

            case listType.NPCs:
                return(File.ReadLines("npcs.txt").ToList());

            case listType.Items:
                return(File.ReadAllLines("items.txt").ToList());

            default:
                return(empty);
            }
        }
Esempio n. 5
0
        private listType GroupToList(Group group)
        {
            listType list = new listType();

            list.name              = group.Name;
            list.displayname       = new displaynameType();
            list.displayname.Value = group.DisplayName;
            return(list);
        }
Esempio n. 6
0
        /// <summary>
        /// Ctor
        /// </summary>
        /// <param name="value"></param>
        public CHTMLList(listType value)
        {
            _listType = listType.UL;

            if (value >= listType.UL && value <= listType.DIR)
            {
                _listType = value;
            }
        }
Esempio n. 7
0
        //For calling this for a list of formulas (as they need both selected subject and topic)
        public ListEdit(BindingList <Subject> sb, Subject selSub, Topic selTop, listType t)
        {
            type     = t;
            subjects = sb;

            selectedSubject = selSub;
            selectedTopic   = selTop;

            InitializeComponent();
        }
Esempio n. 8
0
        //For calling this for a list of formulas (as they need both selected subject and topic)
        public ListEdit(BindingList<Subject> sb, Subject selSub, Topic selTop, listType t)
        {
            type = t;
            subjects = sb;

            selectedSubject = selSub;
            selectedTopic = selTop;

            InitializeComponent();
        }
Esempio n. 9
0
        //For calling this for a list of subjects
        public ListEdit(BindingList <Subject> sb, listType t)
        {
            type     = t;
            subjects = sb;

            selectedSubject = null;
            selectedTopic   = null;

            InitializeComponent();
        }
Esempio n. 10
0
        //For calling this for a list of subjects
        public ListEdit(BindingList<Subject> sb, listType t)
        {
            type = t;
            subjects = sb;

            selectedSubject = null;
            selectedTopic = null;

            InitializeComponent();
        }
Esempio n. 11
0
        private Group ListToGroup(listType list)
        {
            Group group = new Group(list.name, list.displayname.Value);

            group.Authorization = SpecialNames.GetAutorization(group.Name);
            if (group.Authorization == Authorization.UnKnown)
            {
                group.Authorization = Authorization.Allowed; // FIXME
            }
            return(group);
        }
Esempio n. 12
0
        private int GetRandomValue(listType lt)
        {
            int       value;
            Collector currentCulture = cultureList.Find(o => o.name == cultureBox.Text);

            if (lt == listType.Male)
            {
                value = rand.Next(currentCulture.maleNameList.Count());
            }
            else if (lt == listType.Female)
            {
                value = rand.Next(currentCulture.femaleNameList.Count());
            }
            else if (lt == listType.Last)
            {
                value = rand.Next(currentCulture.lastNameList.Count());
            }
            else if (lt == listType.jobHigh)
            {
                value = rand.Next(currentCulture.jobHighList.Count());
            }
            else if (lt == listType.jobLow)
            {
                value = rand.Next(currentCulture.jobLowList.Count());
            }
            else if (lt == listType.homeHigh)
            {
                value = rand.Next(currentCulture.homeHighList.Count());
            }
            else if (lt == listType.homeLow)
            {
                value = rand.Next(currentCulture.homeLowList.Count());
            }
            else if (lt == listType.physicalTrait)
            {
                value = rand.Next(currentCulture.physTraitList.Count());
            }
            else if (lt == listType.personalityTrait)
            {
                value = rand.Next(currentCulture.persTraitList.Count());
            }
            else if (lt == listType.item)
            {
                value = rand.Next(currentCulture.itemList.Count());
            }
            else
            {
                value = rand.Next(currentCulture.otherNameList.Count());
            }
            return(value);
        }
Esempio n. 13
0
        private bool FromResouceListToContacts(resourcelists rlist)
        {
            ContactItem parent = this.addressBook;

            listType[] list2 = rlist.list;
            for (int i = 0; i < list2.Length; i++)
            {
                listType list = list2[i];
                if (list != null && list.name != null)
                {
                    this.GetGroupContact(list, parent);
                }
            }
            return(true);
        }
Esempio n. 14
0
        /*  oma_buddylist (not explicitly used in RCS)
         *      -->rcs
         *      -->oma_pocbuddylist
         *      -->list-c
         *      -->list-d
         *  oma_grantedcontacts
         *      -->rcs
         *      -->oma_buddylist
         *  oma_blockedcontacts
         *      -->rcs_blockedcontacts
         *      -->rcs_revokedcontacts
         *  rcs
         *      -->Default
         *      -->list-a
         *      -->list-b
         */
        private listType[] GetOMALists()
        {
            listType[] omaLists; // Do not cache

            omaLists = new listType[5] {
                new listType(), new listType(), new listType(), new listType(), new listType()
            };

            /*== oma_allcontacts ==*/
            omaLists[0]                   = new listType();
            omaLists[0].displayname       = new displaynameType();
            omaLists[0].name              = SpecialNames.SHARED_OMA_ALLCONTACTS;
            omaLists[0].displayname.Value = "OMA All Contacts";

            /*== oma_blockedcontacts ==*/
            omaLists[1]                   = new listType();
            omaLists[1].displayname       = new displaynameType();
            omaLists[1].name              = SpecialNames.SHARED_OMA_BLOCKEDCONTACTS;
            omaLists[1].displayname.Value = "OMA Blocked Contacts";
            omaLists[1].ExternalTypes.Add(this.GetResourceListAnchorAsExternalType(SpecialNames.SHARED_RCS_BLOCKEDCONTACTS));
            omaLists[1].ExternalTypes.Add(this.GetResourceListAnchorAsExternalType(SpecialNames.SHARED_RCS_REVOKEDCONTACTS));

            /*== oma_buddylist ==*/
            omaLists[2]                   = new listType();
            omaLists[2].displayname       = new displaynameType();
            omaLists[2].name              = SpecialNames.SHARED_OMA_BUDDYLIST;
            omaLists[2].displayname.Value = "OMA BuddyList";
            omaLists[2].ExternalTypes.Add(this.GetResourceListAnchorAsExternalType(SpecialNames.SHARED_RCS));
            omaLists[2].ExternalTypes.Add(this.GetResourceListAnchorAsExternalType(SpecialNames.SHARED_OMA_POCBUDDYLIST));

            /*== oma_grantedcontacts ==*/
            omaLists[3]                   = new listType();
            omaLists[3].displayname       = new displaynameType();
            omaLists[3].name              = SpecialNames.SHARED_OMA_GRANTEDCONTACTS;
            omaLists[3].displayname.Value = "OMA Granted Contacts";
            omaLists[3].ExternalTypes.Add(this.GetResourceListAnchorAsExternalType(SpecialNames.SHARED_RCS));
            omaLists[3].ExternalTypes.Add(this.GetResourceListAnchorAsExternalType(SpecialNames.SHARED_OMA_BUDDYLIST));

            /*== oma_pocbuddylist ==*/
            omaLists[4]                   = new listType();
            omaLists[4].displayname       = new displaynameType();
            omaLists[4].name              = SpecialNames.SHARED_OMA_POCBUDDYLIST;
            omaLists[4].displayname.Value = "OMA POC BuddyList";


            return(omaLists);
        }
Esempio n. 15
0
        private static string[] SortList(string[] ocurrences, listType type)
        {
            SortedList sl = new SortedList();

            foreach (string elm in ocurrences)
            {
                switch (type)
                {
                case listType.MonthDay:
                    if (!sl.ContainsKey(Int32.Parse(elm)) && elm != string.Empty)
                    {
                        sl.Add(Int32.Parse(elm), elm);
                    }
                    break;

                case listType.Time:
                    if (!sl.ContainsKey(elm) && elm != string.Empty)
                    {
                        sl.Add(elm, elm);
                    }
                    break;

                case listType.WeekDay:
                    int wDay = (int)Enum.Parse(typeof(ssWeekDay), elm, true);
                    if (elm != string.Empty && !sl.ContainsKey(wDay))
                    {
                        sl.Add((int)wDay, elm);
                    }
                    break;
                }
            }
            int index = 0;

            string[] result = new string[sl.Count];
            foreach (string elm in sl.Values)
            {
                result[index++] = elm;
            }
            return(result);
        }
Esempio n. 16
0
        public bool GroupUpdate(Group group)
        {
            if (!this.hasResourceLists)
            {
                LOG.Warn("Group connot be updated as XDMS doesn't support 'resource-lists'");
                return(false);
            }

            listType list = this.GroupToList(group);

            byte[] payload = this.Serialize(list, true, true, this.GetSerializerNSFromAUID(XcapService.XCAP_AUID_IETF_RESOURCE_LISTS_ID));
            String url;

            lock (this.xcapSelector)
            {
                this.xcapSelector.reset();
                this.xcapSelector.setAUID(XcapService.XCAP_AUID_IETF_RESOURCE_LISTS_ID)
                .setAttribute("list", "name", group.Name);
                url = this.xcapSelector.getString();
            }
            MyXcapMessage xcapMessage = this.xcapStack.PutElement(url, payload, (uint)payload.Length);

            return(xcapMessage != null && XcapService.IsSuccessCode(xcapMessage.Code));
        }
Esempio n. 17
0
 new CoreTypeMappingParameters(
     listType,
     elementMapping.Converter is ValueConverter elementConverter
Esempio n. 18
0
        private List <EquipKnow> readEquipKnowConfig(XmlNodeList nodes, XmlUtil xmlUtil, listType listType, EquipKnow equip = null)
        {
            List <EquipKnow> items = new List <EquipKnow>();

            try
            {
                foreach (XmlNode node in nodes)
                {
                    EquipKnow item = new EquipKnow();
                    item.ParentEquipKnow = equip;
                    item.Name            = xmlUtil.ReadAttrValue(node, "菜单名字");
                    item.Model           = xmlUtil.ReadAttrValue(node, "模型名");
                    item.Detail          = xmlUtil.ReadAttrValue(node, "详细信息");
                    item.Warm            = xmlUtil.ReadAttrValue(node, "警告信息");
                    string[] offs = xmlUtil.ReadAttrValue(node, "偏移").Split(',');
                    if (xmlUtil.ReadAttrValue(node, "解说语音") != null)
                    {
                        item.audio = xmlUtil.ReadAttrValue(node, "解说语音");
                    }

                    if (offs.Length == 3)
                    {
                        item.Offset = new Vector3(float.Parse(offs[0]), float.Parse(offs[1]), float.Parse(offs[2]));
                    }

                    if (xmlUtil.GetChildNodes(node).Count > 0)
                    {
                        item.EquipKnows.AddRange(readEquipKnowConfig(xmlUtil.GetChildNodes(node), xmlUtil, listType, item));
                    }

                    if (node.Attributes["范围"] != null)
                    {
                        string[] limit  = xmlUtil.ReadAttrValue(node, "范围").Split(',');
                        float    minyaw = float.Parse(limit[0]);
                        float    maxyaw = float.Parse(limit[1]);
                        item.LimitYaw = new Vector2(maxyaw > minyaw ? minyaw : maxyaw, maxyaw > minyaw ? maxyaw : minyaw);
                        float minpitch = float.Parse(limit[2]);
                        float maxpitch = float.Parse(limit[3]);
                        item.LimitPitch = new Vector2(maxpitch > minpitch ? minpitch : maxpitch, maxpitch > minpitch ? maxpitch : minpitch);
                        float minDistance = float.Parse(limit[4]);
                        float maxDistance = float.Parse(limit[5]);
                        item.LimitDistance = new Vector2(maxDistance > minDistance ? minDistance : maxDistance, maxDistance > minDistance ? maxDistance : minDistance);
                    }
                    items.Add(item);
                    if (listType == listType.treeMune)
                    {
                        if (equipKnowDic.ContainsKey(item.Model))
                        {
                            Debug.LogWarning("已存在");
                        }
                        else
                        {
                            equipKnowDic.Add(item.Model, item);
                        }
                    }
                    else
                    {
                        item.showInfo = xmlUtil.ReadAttrValue(node, "显示名称");
                        if (xmlUtil.ReadAttrValue(node, "隐藏模型").Split(',') != null)
                        {
                            string[] touming = xmlUtil.ReadAttrValue(node, "隐藏模型").Split(',');
                            if (touming != null)
                            {
                                for (int i = 0; i < touming.Length; i++)
                                {
                                    item.transparent.Add(touming[i]);
                                }
                            }
                        }
                        if (childrenBtnDic.ContainsKey(item.Model))
                        {
                            Debug.LogWarning("已存在");
                        }
                        else
                        {
                            childrenBtnDic.Add(item.Name, item);
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Debug.LogError("读取xml文件错误" + e);
            }
            return(items);
        }
Esempio n. 19
0
    public override void OnInspectorGUI()
    {
        globalLists myGlobalLists = (globalLists)target;

        typeToAdd = (listType)EditorGUILayout.EnumPopup("Type to Add:", typeToAdd);
        switch (typeToAdd)
        {
        case listType.species:
            #region Add Species
            speciesName  = EditorGUILayout.TextField("Species Name:", speciesName);
            speciesDesc  = EditorGUILayout.TextField("Species Description:", speciesName);
            baseStats[4] = EditorGUILayout.IntField("Base Max HP Stat:", baseStats[4]);
            baseStats[5] = EditorGUILayout.IntField("Base Attack Stat:", baseStats[5]);
            baseStats[6] = EditorGUILayout.IntField("Base Defense Stat:", baseStats[6]);
            baseStats[7] = EditorGUILayout.IntField("Base Speed Stat:", baseStats[7]);

            overworldSprite = EditorGUILayout.ObjectField("Overworld Sprite", overworldSprite, typeof(Sprite), allowSceneObjects: false) as Sprite;
            speciesPortrait = EditorGUILayout.ObjectField("Species Portrait Sprite", speciesPortrait, typeof(Sprite), allowSceneObjects: false) as Sprite;
            EditorGUI.BeginChangeCheck();
            evoNum = EditorGUILayout.DelayedIntField("Number of Evolutions:", evoNum);
            if (EditorGUI.EndChangeCheck())
            {
                evos = new int[evoNum];
            }
            if (evos != null && evos.Length > 0)
            {
                for (int i = 0; i < evos.Length; i++)
                {
                    evos[i] = EditorGUILayout.IntField("Evolution " + i + ":", evos[i]);
                }
            }

            statReqs[4] = EditorGUILayout.IntField("Minimum Max HP:", statReqs[4]);
            statReqs[5] = EditorGUILayout.IntField("Minimum Attack:", statReqs[5]);
            statReqs[6] = EditorGUILayout.IntField("Minimum Defense:", statReqs[6]);
            statReqs[7] = EditorGUILayout.IntField("Minimum Speed:", statReqs[7]);

            decReq           = EditorGUILayout.ObjectField("Required Decoration", decReq, typeof(decorationObject), allowSceneObjects: false) as decorationObject;
            timeReq          = (timeOfDay)EditorGUILayout.EnumPopup("Time Requirement:", timeReq);
            levelCoefficient = EditorGUILayout.Slider("Level Coefficient:", levelCoefficient, .5f, 2f);
            seenMon          = EditorGUILayout.ObjectField("Required Decoration", decReq, typeof(baseSpecies), allowSceneObjects: false) as baseSpecies;

            egg = EditorGUILayout.Toggle("Is Egg:", egg);
            if (egg)
            {
                hatchTime = EditorGUILayout.IntField("Hatch Time in Sec:", hatchTime);
            }


            if (overworldSprite != null && speciesPortrait != null)
            {
                if (GUILayout.Button("New Species"))
                {
                    baseSpecies newSpecies = ScriptableObject.CreateInstance("baseSpecies") as baseSpecies;
                    newSpecies.speciesNumber = myGlobalLists.speciesList.Count;
                    newSpecies.speciesName   = speciesName == "" ? "Error" : speciesName;
                    newSpecies.speciesDesc   = speciesDesc == "" ? "Error" : speciesDesc;
                    for (int i = 0; i < 9; i++)
                    {
                        newSpecies.baseStats[i] = baseStats[i] < 0 ? 0: baseStats[i];
                    }
                    newSpecies.overworld       = overworldSprite;
                    newSpecies.speciesPortrait = speciesPortrait;
                    newSpecies.evolutions      = new int[evoNum];
                    for (int i = 0; i < evoNum; i++)
                    {
                        newSpecies.evolutions[i] = evos[i] < 0 ? 0: evos[i];
                    }
                    for (int i = 0; i < 9; i++)
                    {
                        newSpecies.statReqs[i] = statReqs[i] < 0 ? 0: statReqs[i];
                    }
                    newSpecies.decReq           = decReq;
                    newSpecies.timeReq          = (int)timeReq;
                    newSpecies.levelCoefficient = levelCoefficient;
                    newSpecies.seenMon          = seenMon;
                    newSpecies.egg = egg;
                    if (egg)
                    {
                        newSpecies.hatchtime = hatchTime < 0? 0:hatchTime;
                    }
                    else
                    {
                        newSpecies.hatchtime = 0;
                    }
                    myGlobalLists.speciesList.Add(newSpecies);
                    if (speciesName != "")
                    {
                        AssetDatabase.CreateAsset(newSpecies, "Assets/Monsters/" + speciesName + ".asset");
                    }
                    else
                    {
                        AssetDatabase.CreateAsset(newSpecies, "Assets/Monsters/Error.asset");
                    }
                }
            }
            #endregion
            break;

        case listType.decoration:
            #region Add Decoration
            decName        = EditorGUILayout.TextField("Decoration Name:", decName);
            decDescription = EditorGUILayout.TextField("Decoration Description:", decDescription);
            statBoosts[2]  = EditorGUILayout.IntField("XP Boost:", statBoosts[2]);
            statBoosts[4]  = EditorGUILayout.IntField("Max HP Boost:", statBoosts[4]);
            statBoosts[5]  = EditorGUILayout.IntField("Attack Boost:", statBoosts[5]);
            statBoosts[6]  = EditorGUILayout.IntField("Defense Boost:", statBoosts[6]);
            statBoosts[7]  = EditorGUILayout.IntField("Speed Boost:", statBoosts[7]);
            statBoosts[8]  = EditorGUILayout.IntField("Happiness Boost:", statBoosts[8]);

            decSprite = EditorGUILayout.ObjectField("Overworld Sprite", decSprite, typeof(Sprite), allowSceneObjects: false) as Sprite;

            if (decSprite != null)
            {
                if (GUILayout.Button("New Decoration"))
                {
                    decorationObject newDecoration = ScriptableObject.CreateInstance("decorationObject") as decorationObject;
                    newDecoration.decorationNumber = myGlobalLists.decorationList.Count;
                    newDecoration.decName          = decName == "" ? "Error" : decName;
                    newDecoration.decDescription   = decDescription == "" ? "Error" : decDescription;
                    for (int i = 0; i < 9; i++)
                    {
                        newDecoration.statBoosts[i] = statBoosts[i] < 0 ? 0: statBoosts[i];
                    }
                    newDecoration.decSprite = decSprite;
                    if (decName != "")
                    {
                        AssetDatabase.CreateAsset(newDecoration, "Assets/Decorations/" + decName + ".asset");
                    }
                    else
                    {
                        AssetDatabase.CreateAsset(newDecoration, "Assets/Decorations/Error.asset");
                    }
                    myGlobalLists.decorationList.Add(newDecoration);
                }
            }
            #endregion
            break;

        case listType.none:
            break;
        }

        DrawDefaultInspector();
    }