//public Contrast(Analysis analysis) //{ // this.analysis = analysis; //} public Node ContrastFX() { Node defense = analysis.AnalysisData(); Node attack = analysisN.AnalysisData(); if (defense != null && attack != null) { if (defense.Rate <= attack.Rate) { return(attack); } else { return(defense); } } else { if (defense != null) { return(attack); } else if (attack != null) { return(attack); } } return(null); }
public override Node Defense(int x, int y, Context context, int qz) { var node = LayoutNodes[x + "" + y]; analysis = new Analysis(LayoutNodes.CheckFind.Copy(), node, !base.IsBlanck); Analysis analysis1 = new Analysis(LayoutNodes.CheckFind.Copy(), CurentNode, base.IsBlanck); Contrast Contrast = new Contrast(analysis, analysis1); var _node = Contrast.ContrastFX(); if (_node == null) { Nodes nodes = Analysis.AnalysisData(IsBlanck, LayoutNodes.CheckFind.Copy(), false); if (nodes != null) { _node = nodes.NextNode; if (_node == null) { _node = analysis1.GetDefautNode(node); } } else { _node = analysis1.GetDefautNode(node); } } if (_node != null) { CurentNode = SetState(1, _node.cpoint.X, _node.cpoint.Y, qz); //drawTool.ShowPoint("" + CurentNode.RateText, CurentNode, 1); //CurentNode.ShowInfo(2); //CurentNode.cpoint.ShowInfo(3); return(CurentNode); } return(null); }