Exemplo n.º 1
0
        public String GetValue(string rowhead, int state, GraphModel.Graph graph)
        {
            Link[] links       = graph.links;
            int    length      = links.Length;
            int    sourceState = state;
            int    targetState = (int)Char.GetNumericValue(rowhead, 1);

            for (int i = 0; i < length; i++)
            {
                if (links[i].source.name == sourceState && links[i].target.name == targetState)
                {
                    return(links[i].value);
                }
            }
            return("0");
        }
Exemplo n.º 2
0
        public String GetValue(string rowhead, int state, GraphModel.Graph graph)
        {
            Link[] links       = graph.links;
            int    length      = links.Length;
            int    sourceState = state;
            string rawInput    = rowhead.Substring(1).Remove(rowhead.Length - 2);

            string[] inputs      = rawInput.Split(',');
            int      targetState = (int)Char.GetNumericValue(inputs[1], 0);
            string   label       = inputs[0];

            for (int i = 0; i < length; i++)
            {
                if (
                    links[i].source.name == sourceState &&
                    links[i].target.name == targetState &&
                    links[i].name == label
                    )
                {
                    return("1");
                }
            }
            return("0");
        }