コード例 #1
0
ファイル: TestTree.cs プロジェクト: Deluvi/Calculator
        public void TestCot()
        {
            double a    = 45;
            INode  tree = new NodeFunction(new NodeValue(a), FunctionType.COTANGENT);

            Assert.AreEqual(0.61736, tree.GetResult(), 0.001, "Cotangent does not work.");
        }
コード例 #2
0
ファイル: BHNode.cs プロジェクト: morathias/IA-Algorithms
 public void setFunctionToExecute(NodeFunction function)
 {
     if (function != null)
     {
         _nodeFunction = function;
     }
 }
コード例 #3
0
ファイル: TestTree.cs プロジェクト: Deluvi/Calculator
        public void TestSin()
        {
            double a    = 90;
            INode  tree = new NodeFunction(new NodeValue(a), FunctionType.SINUS);

            Assert.AreEqual(0.8939966, tree.GetResult(), 0.001, "Sine does not work.");
        }
コード例 #4
0
ファイル: TestTree.cs プロジェクト: Deluvi/Calculator
        public void TestCos()
        {
            double a    = 45;
            INode  tree = new NodeFunction(new NodeValue(a), FunctionType.COSINUS);

            Assert.AreEqual(0.525321, tree.GetResult(), 0.001, "Cosine does not work.");
        }
コード例 #5
0
ファイル: TestTree.cs プロジェクト: Deluvi/Calculator
        public void TestTan()
        {
            double a    = 45;
            INode  tree = new NodeFunction(new NodeValue(a), FunctionType.TANGENT);

            Assert.AreEqual(1.619775, tree.GetResult(), 0.001, "Sine does not work.");
        }
コード例 #6
0
 private static void ApplyToAllNodes(TreeNodeCollection nodes, NodeFunction nodeFunction)
 {
     foreach (TreeNode node in nodes)
     {
         ApplyToAllNodes(node.Nodes, nodeFunction);
         nodeFunction(node);
     }
 }
コード例 #7
0
        public Task <byte[]> NodeQueryAsync(string addr, BlockParameter blockParameter = null)
        {
            var nodeFunction = new NodeFunction();

            nodeFunction.Addr = addr;

            return(ContractHandler.QueryAsync <NodeFunction, byte[]>(nodeFunction, blockParameter));
        }
コード例 #8
0
        public void onMessage(NodeFunction handler)
        {
            skype.MessageStatus += (message, status) =>
            {
                if (status != TChatMessageStatus.cmsReceived)
                {
                    return;
                }

                handler(new {
                    chatId      = message.Chat.Blob,
                    chatName    = message.ChatName,
                    messageId   = message.Guid,
                    messageText = message.Body,
                    messageType = message.Type
                });
            };
        }
コード例 #9
0
 public Task <byte[]> NodeQueryAsync(NodeFunction nodeFunction, BlockParameter blockParameter = null)
 {
     return(ContractHandler.QueryAsync <NodeFunction, byte[]>(nodeFunction, blockParameter));
 }
コード例 #10
0
 /// <summary>
 /// スクリプト実行用公開エントリーポイントリストからエントリーポイントを削除します。
 /// </summary>
 public void RemovePublicExecuteEntryPoint(NodeFunction func)
 {
     PublicExecuteEntryPointList.RemoveAll(s => s.function == func);
     UpdateButtonEnable();
 }
コード例 #11
0
 /// <summary>
 /// スクリプト実行用公開エントリーポイントリストにエントリーポイントを追加します。
 /// </summary>
 public void AddPublicExecuteEntryPoint(object owner, NodeFunction func)
 {
     PublicExecuteEntryPointList.Add(new EntryPoint(owner, func));
     UpdateButtonEnable();
 }
コード例 #12
0
 public EntryPoint(object owner, NodeFunction func)
 {
     this.owner    = owner;
     this.function = func;
 }
コード例 #13
0
 public Node_Check_Condition(NodeFunction func)
 {
     m_function = func;
 }
コード例 #14
0
 public Node_Call_Delegate(NodeFunction func)
 {
     m_function = func;
 }
コード例 #15
0
 public void onAttachmentStatus(NodeFunction handler)
 {
     ((_ISkypeEvents_Event)skype).AttachmentStatus += status => handler(status);
 }
コード例 #16
0
 public override void visit(NodeFunction node)
 {
     nextNode = node.getNext();
 }                                                                            // Not sure if this is right..
コード例 #17
0
 public abstract void visit(NodeFunction node);