Exemplo n.º 1
0
        /// <summary>
        /// Gets an edge given an edge id. Throws if no such edge exist.
        /// </summary>
        /// <param name="edgeId">The id of the edge</param>
        /// <returns>The edge with matching id if it exists</returns>
        public Edge GetEdge(EdgeId edgeId)
        {
            if (Unrestricted)
            {
                UnrestrictedEdge headTail;
                if (m_unrestrictedEdges.TryGetValue(edgeId, out headTail))
                {
                    VertexType vt   = headTail.m_headVertexType;
                    Vertex     head = vt.GetVertex(headTail.m_headVertexId);
                    vt = headTail.m_tailVertexType;
                    Vertex tail = vt.GetVertex(headTail.m_tailVertexId);
                    return(new Edge(MyGraph, this, edgeId, head, tail));
                }
            }
            else
            {
                UInt64 vertexVertex;
                if (m_restrictedEdges.TryGetValue(edgeId, out vertexVertex))
                {
                    VertexId headId = (VertexId)(vertexVertex >> 32);
                    Vertex   head   = HeadType.GetVertex(headId);
                    Vertex   tail   = TailType.GetVertex((VertexId)vertexVertex);
                    return(new Edge(MyGraph, this, edgeId, head, tail));
                }
            }

            throw new EdgeDoesNotExistException();
        }
Exemplo n.º 2
0
 public Sound(char consonant, char vowel, char vowel2, bool isDouble, TailType tail)
 {
     Consonant = consonant;
     Vowel     = vowel;
     Vowel2    = vowel2;
     IsDouble  = isDouble;
     Tail      = tail;
 }
Exemplo n.º 3
0
        protected override void OnAfterComplete(ITextControl textControl, ref TextRange nameRange,
                                                ref TextRange decorationRange, TailType tailType, ref Suffix suffix,
                                                ref IRangeMarker caretPositionRangeMarker)
        {
            // TODO: completion with a space can break this
            base.OnAfterComplete(textControl, ref nameRange, ref decorationRange,
                                 tailType, ref suffix, ref caretPositionRangeMarker);

            if (context != null)
            {
                context.CompletionManager.Locks.QueueReadLock("Code completion inside markup extension",
                                                              () => ExecuteManualCompletion(textControl));
            }
        }
        protected override void OnAfterComplete(ITextControl textControl, ref TextRange nameRange,
            ref TextRange decorationRange, TailType tailType, ref Suffix suffix,
            ref IRangeMarker caretPositionRangeMarker)
        {
            // TODO: completion with a space can break this
            base.OnAfterComplete(textControl, ref nameRange, ref decorationRange,
                tailType, ref suffix, ref caretPositionRangeMarker);

            if (context != null)
            {
                context.CompletionManager.Locks.QueueReadLock("Code completion inside markup extension",
                    () => ExecuteManualCompletion(textControl));
            }
        }
Exemplo n.º 5
0
 public decimal[] GetParentReturnsByTailType(TailType tailType)
 {
     switch (tailType)
     {
         case TailType.LeftTail:
             return ParentLeftTail.ToArray();
         case TailType.LeftNormal:
             return ParentLeftNormal.ToArray();
         case TailType.RightNormal:
             return ParentRightNormal.ToArray();
         case TailType.RightTail:
             return ParentRightTail.ToArray();
         default:
             throw new NotImplementedException();
     }
 }
Exemplo n.º 6
0
        protected override void OnAfterComplete(ITextControl textControl, ref TextRange nameRange,
                                                ref TextRange decorationRange, TailType tailType, ref Suffix suffix,
                                                ref IRangeMarker caretPositionRangeMarker)
        {
            // TODO: completion with a space can break this
            base.OnAfterComplete(textControl, ref nameRange, ref decorationRange,
                                 tailType, ref suffix, ref caretPositionRangeMarker);

            if (context != null)
            {
                context.CompletionManager.Locks.QueueReadLock("Code completion inside markup extension",
                                                              () => context.CompletionManager.ExecuteManualCompletion(
                                                                  CodeCompletionType.AutomaticCompletion, textControl, context.Solution, EmptyAction.Instance,
                                                                  context.CompletionManager.GetPrimaryEvaluationMode(CodeCompletionType.AutomaticCompletion),
                                                                  AutocompletionBehaviour.DoNotAutocomplete));
            }
        }
        protected override void OnAfterComplete(ITextControl textControl, ref TextRange nameRange,
            ref TextRange decorationRange, TailType tailType, ref Suffix suffix,
            ref IRangeMarker caretPositionRangeMarker)
        {
            // TODO: completion with a space can break this
            base.OnAfterComplete(textControl, ref nameRange, ref decorationRange,
                tailType, ref suffix, ref caretPositionRangeMarker);

            if (context != null)
            {
                context.CompletionManager.Locks.QueueReadLock("Code completion inside markup extension",
                    () => context.CompletionManager.ExecuteManualCompletion(
                        CodeCompletionType.AutomaticCompletion, textControl, context.Solution, EmptyAction.Instance,
                        context.CompletionManager.GetPrimaryEvaluationMode(CodeCompletionType.AutomaticCompletion),
                        AutocompletionBehaviour.DoNotAutocomplete));
            }
        }
Exemplo n.º 8
0
 /// <summary>
 /// Gets an edge given an edge id. Throws if no such edge exist.
 /// </summary>
 /// <param name="edgeId">The id of the edge</param>
 /// <param name="polymorphic">If true and id isn't found in this EdgeType continue search into sub types</param>
 /// <param name="errorIfNotFound">Indicate what to do if <see cref="Edge"/> does not exist</param>
 /// <returns>The edge with matching id if it exists</returns>
 public Edge GetEdge(EdgeId edgeId, bool polymorphic = false, bool errorIfNotFound = true)
 {
     if (Unrestricted)
     {
         UnrestrictedEdge headTail;
         if (m_unrestrictedEdges.TryGetValue(edgeId, out headTail))
         {
             VertexType vt   = headTail.m_headVertexType;
             Vertex     head = vt.GetVertex(headTail.m_headVertexId);
             vt = headTail.m_tailVertexType;
             Vertex tail = vt.GetVertex(headTail.m_tailVertexId);
             return(new Edge(MyGraph, this, edgeId, head, tail));
         }
     }
     else
     {
         UInt64 vertexVertex;
         if (m_restrictedEdges.TryGetValue(edgeId, out vertexVertex))
         {
             VertexId headId = (VertexId)(vertexVertex >> 32);
             Vertex   head   = HeadType.GetVertex(headId);
             Vertex   tail   = TailType.GetVertex((VertexId)vertexVertex);
             return(new Edge(MyGraph, this, edgeId, head, tail));
         }
     }
     if (polymorphic)
     {
         foreach (var et in m_subTypes)
         {
             var e = et.GetEdge(edgeId, polymorphic, false);
             if (e != null)
             {
                 return(e);
             }
         }
     }
     if (errorIfNotFound)
     {
         throw new EdgeDoesNotExistException();
     }
     return(null);
 }
        private void SetAnalysisByTailType(TailType tailType, UnconditionalAnalysis analysis)
        {
            switch (tailType)
            {
            case TailType.LeftTail:
                LeftTail = analysis;
                return;

            case TailType.LeftNormal:
                LeftNormal = analysis;
                return;

            case TailType.RightNormal:
                RightNormal = analysis;
                return;

            case TailType.RightTail:
                RightTail = analysis;
                return;

            default:
                throw new NotImplementedException();
            }
        }
Exemplo n.º 10
0
 public Tail(TailType t) : base(NodeType.TailNode)
 {
     this.type = t;
 }
Exemplo n.º 11
0
 /// <summary>
 ///   Sets the Tail type of the creature specified.
 ///   - nTailType (CREATURE_TAIL_TYPE_*)
 ///   CREATURE_TAIL_TYPE_NONE
 ///   CREATURE_TAIL_TYPE_LIZARD
 ///   CREATURE_TAIL_TYPE_BONE
 ///   CREATURE_TAIL_TYPE_DEVIL
 ///   - oCreature: the creature to change the Tail type for.
 ///   Note: Only two creature model types will support Tails.
 ///   The MODELTYPE for the part based (playable) races 'P'
 ///   and MODELTYPE 'T'in the appearance.2da
 /// </summary>
 public static void SetCreatureTailType(TailType nTailType, uint oCreature = OBJECT_INVALID)
 {
     Internal.NativeFunctions.StackPushObject(oCreature);
     Internal.NativeFunctions.StackPushInteger((int)nTailType);
     Internal.NativeFunctions.CallBuiltIn(795);
 }
Exemplo n.º 12
0
        protected override void OnAfterComplete(ITextControl textControl, ref TextRange nameRange, ref TextRange decorationRange, TailType tailType,
                                                ref Suffix suffix, ref IRangeMarker caretPositionRangeMarker)
        {
            Solution.GetPsiServices().Files.CommitAllDocuments();
            var psiServices = Solution.GetPsiServices();

            using (var transactionCookie = new PsiTransactionCookie(psiServices, DefaultAction.Rollback, "Lookup item"))
            {
                ImportHelper.AddMissingNamespaceImport(
                    (ICSharpTypeAndNamespaceHolderDeclaration)Context.BasicContext.File,
                    CSharpElementFactory.GetInstance(Context.PsiModule), "System.Reflection");
                psiServices.Caches.Update();
                transactionCookie.Commit();
            }
        }
		/// <summary>
		/// Enable the selected tail
		/// </summary>
		void SetTail(TailType tail)
		{
			//Log.Debug("SetTail : "+tail );
			
			//disable all tails		
			foreach(GameObject t in tails)
			{
				t.SetActive(false);
			}

			//enable the one
			tails[(int)tail].SetActive(true);

			//TODO FIX this, because this overwrites the outline colors too
			//MeshRenderer meshRenderer = tails[(int)tail].GetComponent<MeshRenderer>();
			//meshRenderer.material.color = bubbleColor;
			
		}//SetTail()
		}//Update()

		/// <summary>
		/// Set the tail orientation based on id
		/// </summary>
		public void SetTail(string id)
		{
			if(id == "N") tail = TailType.N;
			if(id == "NE") tail = TailType.NE;
			if(id == "E") tail = TailType.E;
			if(id == "SE") tail = TailType.SE;
			if(id == "S") tail = TailType.S;
			if(id == "SW") tail = TailType.SW;
			if(id == "W") tail = TailType.W;
			if(id == "NW") tail = TailType.NW;

			SetTail(tail);
		}
 protected override void OnAfterComplete(ITextControl textControl, ref TextRange nameRange, ref TextRange decorationRange, TailType tailType,
                                         ref Suffix suffix, ref IRangeMarker caretPositionRangeMarker)
 {
 }