public void CutAllConnection() { if (_actionTrue != null) { _actionTrue.Cut(_actionTrue.NextNode); _actionTrue = null; } if (_actionAverage != null) { _actionAverage.Cut(_actionAverage.NextNode); _actionAverage = null; } if (_listActionAndWeight != null) { for (int i = 0; i < _listActionAndWeight.Count; i++) { var action = _listActionAndWeight[i].Action; action.Cut(action.NextNode); } _listActionAndWeight = null; } }
/// <summary> /// Create ActionContainer that contain only true node. /// </summary> public static ActionContainer CreateMove(TBGState s, BoardPath path) { var cpState = new TBGState(s); var cpUnitCurrent = cpState.UnitCurrent; var cpPath = new BoardPath(path); // update unit pos cpUnitCurrent.Pos = cpPath.Last; // update wait list cpState.UpdateWaitListNext(); var moveNode = new ActionNode(new TBGActionMove( s.UnitCurrent.Owner, s.UnitCurrentIndex, cpPath), // new StateNode(cpState)); return ActionContainer.CreateTrue(moveNode); }
public static ActionContainer CreateAverage(ActionNode true_, ActionNode average) { return new ActionContainer(true_, average, null); }
public static ActionContainer CreateTrue(ActionNode true_) { return new ActionContainer(true_, null, null); }
public ActionContainer(ActionNode true_, ActionNode average, List<ActionAndWeight> listActionAndWeight) { _actionTrue = true_; _actionAverage = average; _listActionAndWeight = listActionAndWeight; }