Exemplo n.º 1
0
        /// <summary>Speak the text.</summary>
        public void Speak()
        {
            Silence();
            stack.Clear();
            clipDict.Clear();

            foreach (AudioClip clip in Clips)
            {
                clipDict.Add("#" + clip.name + "#", clip);
            }

            string[] speechParts = splitRegex.Split(Text).Where(s => s != string.Empty).ToArray();

            System.Text.RegularExpressions.MatchCollection mc = splitRegex.Matches(Text);

            int index = 0;

            foreach (System.Text.RegularExpressions.Match match in mc)
            {
                //Debug.Log("MATCH: '" + match + "' - " + Text.IndexOf(match.ToString(), index));
                stack.Add(index = Text.IndexOf(match.ToString(), index), match.ToString());
                index++;
            }

            index = 0;
            foreach (string speech in speechParts)
            {
                //Debug.Log("PART: '" + speech + "' - " + Text.IndexOf(speech, index));
                stack.Add(index = Text.IndexOf(speech, index), speech);
                index++;
            }

            StartCoroutine(processStack());
        }
Exemplo n.º 2
0
        protected override void OnCompile(BaseClothing o, System.Collections.Generic.IDictionary <string, System.SimpleType> data)
        {
            if (o == null || o.Deleted)
            {
                data.Clear();
                return;
            }

            base.OnCompile(o, data);

            data.Add("resource", o.Resource.ToString());
            data.Add("quality", o.Quality.ToString());

            data.Add("crafter", o.Crafter != null ? o.Crafter.Serial.Value : -1);

            data.Add("identified", o.Identified);

            data.Add("rarity", o.ArtifactRarity);

            data.Add("hits", o.HitPoints);
            data.Add("hitsmax", o.MaxHitPoints);

            data.Add("reqstr", o.StrRequirement);
            data.Add("reqrace", o.RequiredRace != null ? o.RequiredRace.RaceID : -1);

            data.Add("bonusstr", o.BaseStrBonus);
            data.Add("bonusdex", o.BaseDexBonus);
            data.Add("bonusint", o.BaseIntBonus);
        }
Exemplo n.º 3
0
        public List <string> GetFormData()
        {
            List <string> dataList  = new List <string>();
            PdfReader     pdfReader = new PdfReader(PdfLocation);

            System.Collections.Generic.IDictionary <string, iTextSharp.text.pdf.AcroFields.Item> fields = pdfReader.AcroFields.Fields;
            AcroFields.Item acroFieldItem;
            PdfDictionary   pdfDictionary;
            int             flags;
            int             fieldInstance = 0;


            foreach (var field in fields)
            {
                acroFieldItem = field.Value;

                /* http://api.itextpdf.com/com/itextpdf/text/pdf/AcroFields.Item.html
                 * field.Value.GetMerged		Retrieve the merged dictionary for the given instance.
                 * field.Value.GetPage			Retrieve the page number of the given instance
                 * field.Value.GetTabOrder		Gets the tabOrder
                 * field.Value.GetValue			Retrieve the value dictionary of the given instance
                 * field.Value.GetWidget		Retrieve the widget dictionary of the given instance
                 * field.Value.GetWidgetRef		Retrieve the reference to the given instance
                 *
                 * field.Value.MarkUsed			Mark all the item dictionaries used matching the given flags
                 * field.Value.Size				Preferred method of determining the number of instances of a given field
                 * */

                // Size should always be one unless there is more than one of a field with the same name
                fieldInstance = 0;
                do
                {
                    // http://api.itextpdf.com/com/itextpdf/text/pdf/PdfDictionary.html
                    // http://api.itextpdf.com/com/itextpdf/text/pdf/PdfName.html

                    /* PDF Name http://www.pdf-tools.com/public/downloads/pdf-reference/pdfreference12.pdf
                     *
                     * AP		Appearance dictionary
                     * AS		Appearance state
                     * BS		Border Style
                     * D		Dash Array
                     * N		Normal appearance
                     * R		Rollover appearance
                     * W		Width
                     *
                     * */
                    pdfDictionary = field.Value.GetMerged(fieldInstance);
                    flags         = pdfDictionary.GetAsNumber(PdfName.FF).IntValue;

                    fieldInstance++;
                } while (fieldInstance < field.Value.Size);

                dataList.Add(field.Key + " " + field.Value);
            }
            pdfReader.Close();
            fields.Clear();
            acroFieldItem = null;
            pdfDictionary = null;
            return(dataList);
        }
Exemplo n.º 4
0
 public virtual void Clear()
 {
     rapidAccessForSystemClassesByName.Clear();
     rapidAccessForUserClassesByName.Clear();
     rapidAccessForSystemClassesByName = null;
     rapidAccessForUserClassesByName   = null;
     allClassInfos.Clear();
 }
Exemplo n.º 5
0
 protected internal virtual void ResetListeners()
 {
     foreach (Net.Vpc.Upa.Impl.Persistence.MultiRecordListTracker tracker in (currentRecords).Values)
     {
         tracker.record.RemovePropertyChangeListener(tracker.changeListener);
     }
     currentRecords.Clear();
 }
Exemplo n.º 6
0
 public virtual Net.Vpc.Upa.Persistence.EntityExecutionContext ResetHints()
 {
     if (hints != null)
     {
         hints.Clear();
     }
     hints = null;
     return(this);
 }
 private static void Construct()
 {
     operators.Clear();
     operators.Add('+', st => st.Pop <int>() + st.Pop <int>());
     operators.Add('-', st => - st.Pop <int>() - st.Pop <int>());
     operators.Add('/', st => (int)(1.0 / st.Pop <int>() * st.Pop <int>()));
     operators.Add('*', st => st.Pop <int>() * st.Pop <int>());
     operators.Add('#', st => - st.Pop <int>());
 }
Exemplo n.º 8
0
 public override void Clear(bool setToNull)
 {
     base.Clear(setToNull);
     oidsOfNNoi.Clear();
     if (setToNull)
     {
         oidsOfNNoi = null;
     }
 }
Exemplo n.º 9
0
 /// <exception cref="System.Exception"></exception>
 public virtual void Commit()
 {
     storageEngine.Commit();
     NeoDatis.Odb.OID oid = null;
     // release update mutexes
     System.Collections.IEnumerator iterator = oidsLockedForUpdate.Keys.GetEnumerator(
         );
     while (iterator.MoveNext())
     {
         oid = (NeoDatis.Odb.OID)iterator.Current;
         connectionManager.UnlockOidForConnection(oid, this);
         if (NeoDatis.Odb.OdbConfiguration.IsDebugEnabled(LogId))
         {
             NeoDatis.Tool.DLogger.Debug("Release object lock for " + oid);
         }
     }
     oidsLockedForUpdate.Clear();
 }
Exemplo n.º 10
0
 public override NeoDatis.Odb.Core.Layers.Layer2.Meta.AbstractObjectInfo GetMetaRepresentation
     (object @object, NeoDatis.Odb.Core.Layers.Layer2.Meta.ClassInfo ci, bool recursive
     , System.Collections.Generic.IDictionary <object, NeoDatis.Odb.Core.Layers.Layer2.Meta.NonNativeObjectInfo
                                               > alreadyReadObjects, NeoDatis.Odb.Core.Layers.Layer1.Introspector.IIntrospectionCallback
     callback)
 {
     clientOids.Clear();
     aois.Clear();
     objects.Clear();
     return(base.GetObjectInfo(@object, ci, recursive, alreadyReadObjects, callback));
 }
Exemplo n.º 11
0
        protected override void OnCompile(HouseRegion o, System.Collections.Generic.IDictionary <string, System.SimpleType> data)
        {
            if (o == null || !o.Registered)
            {
                data.Clear();
                return;
            }

            base.OnCompile(o, data);

            data.Add("house", o.House != null ? o.House.Serial.Value : -1);
        }
Exemplo n.º 12
0
        protected override void OnCompile(GuardedRegion o, System.Collections.Generic.IDictionary <string, System.SimpleType> data)
        {
            if (o == null || !o.Registered)
            {
                data.Clear();
                return;
            }

            base.OnCompile(o, data);

            data.Add("guarded", !o.Disabled);
            data.Add("allowreds", o.AllowReds);
        }
Exemplo n.º 13
0
 public virtual void Clear(bool setToNull)
 {
     if (objects != null)
     {
         objects.Clear();
         oids.Clear();
         objectInfoPointersCacheFromOid.Clear();
         insertingObjects.Clear();
         objectPositionsByIds.Clear();
         readingObjectInfo.Clear();
         unconnectedZoneOids.Clear();
     }
     if (setToNull)
     {
         objects = null;
         oids    = null;
         objectInfoPointersCacheFromOid = null;
         insertingObjects     = null;
         objectPositionsByIds = null;
         readingObjectInfo    = null;
         unconnectedZoneOids  = null;
     }
 }
Exemplo n.º 14
0
        public System.Collections.Generic.IDictionary <string, string> Parse(
            System.IO.Stream input)
        {
            _data.Clear();
            _context.Clear();

            // https://dotnetfiddle.net/rrR2Bb
            YamlDotNet.RepresentationModel.YamlStream yaml = new YamlDotNet.RepresentationModel.YamlStream();
            yaml.Load(new System.IO.StreamReader(input, detectEncodingFromByteOrderMarks: true));


            foreach (YamlDotNet.RepresentationModel.YamlDocument doc in yaml.Documents)
            {
                YamlDotNet.RepresentationModel.YamlMappingNode mapping =
                    (YamlDotNet.RepresentationModel.YamlMappingNode)doc.RootNode;

                // The document node is a mapping node
                VisitYamlMappingNode(mapping);
            }

            return(_data);
        }
Exemplo n.º 15
0
        protected override void OnCompile(BaseArmor o, System.Collections.Generic.IDictionary <string, System.SimpleType> data)
        {
            if (o == null || o.Deleted)
            {
                data.Clear();
                return;
            }

            base.OnCompile(o, data);

            data.Add("resource", o.Resource.ToString());
            data.Add("quality", o.Quality.ToString());
            data.Add("durability", o.Durability.ToString());

            data.Add("crafter", o.Crafter != null ? o.Crafter.Serial.Value : -1);

            data.Add("identified", o.Identified);

            data.Add("rarity", o.ArtifactRarity);

            data.Add("slayers", JoinData(o.Slayer, o.Slayer2));

            data.Add("armorbase", o.ArmorBase);

            data.Add("hits", o.HitPoints);
            data.Add("hitsmax", o.MaxHitPoints);

            data.Add("reqstr", o.StrRequirement);
            data.Add("reqdex", o.DexRequirement);
            data.Add("reqint", o.IntRequirement);
            data.Add("reqrace", o.RequiredRace != null ? o.RequiredRace.RaceID : -1);

            data.Add("bonusstr", o.StrBonus);
            data.Add("bonusdex", o.DexBonus);
            data.Add("bonusint", o.IntBonus);
            data.Add("bonusluck", o.GetLuckBonus());
            data.Add("bonusdurability", o.GetDurabilityBonus());
        }
Exemplo n.º 16
0
 public virtual bool HasNext()
 {
     try {
         if (closed || (resultSet).IsClosed)
         {
             log.TraceEvent(System.Diagnostics.TraceEventType.Warning, 90, Net.Vpc.Upa.Impl.FwkConvertUtils.LogMessageExceptionFormatter("ResultSet closed, unable to retrieve next record", null));
         }
         updates.Clear();
         return(resultSet.NextResult());
     } catch (System.Exception e) {
         bool alreadyClosed = false;
         try {
             alreadyClosed = (resultSet).IsClosed;
         } catch (System.Exception e2) {
         }
         //ignore
         if (alreadyClosed)
         {
             return(false);
         }
         throw new Net.Vpc.Upa.Exceptions.FindException(e, new Net.Vpc.Upa.Types.I18NString("ReadQueryHasNextFailed"));
     }
 }
Exemplo n.º 17
0
 public virtual void ClearOnCommit()
 {
     objectPositionsByIds.Clear();
     unconnectedZoneOids.Clear();
 }
Exemplo n.º 18
0
 public virtual V Put(System.Type key, V @value)
 {
     cache.Clear();
     return(data[key] = @value);
 }
 public virtual void Clear()
 {
     oids.Clear();
     modifiedObjectOids.Clear();
     modifiedObjectOidList.Clear();
 }
Exemplo n.º 20
0
 public void Clear()
 {
     _Dict.Clear();
 }
Exemplo n.º 21
0
 public virtual void Reset()
 {
     classMap.Clear();
     construtorsMap.Clear();
 }
Exemplo n.º 22
0
 // Object is in memory, do not need to re-put in map. The key has
 // not changed
 // readingObjectInfo.put(oid, objects);
 public virtual void ClearObjectInfos()
 {
     readingObjectInfo.Clear();
 }