/* * public static bool IsNbEnemy(CellObjCtrl cctrl, int relativeDir) * { * if (cctrl._TgtObj == null) { * return false; * } * * CellObjCtrl nbCtrl = GetNbCellObjCtrl (cctrl, relativeDir); * bool bEnemy = false; * if (nbCtrl != null && nbCtrl._TgtObj!=null) { * var settingMe = * cctrl._TgtObj.GetComponent<MiroV1ModelSetting> (); * var settingNb = * nbCtrl._TgtObj.GetComponent<MiroV1ModelSetting> (); * bEnemy = (settingMe._CampName!=settingNb._CampName); * } * * return bEnemy; * }*/ public static bool IsBackToBack(CellObjCtrl ctrl) { if (ctrl == null || ctrl._TgtObj == null) { return(false); } bool bBwdFriend = CellObjCtrlUtils.IsNbSameCamp(ctrl, 3); if (bBwdFriend) { CellObjCtrl bwdCtrl = GetNbCellObjCtrl(ctrl, 3); if (bwdCtrl.GetDir() == ctrl.GetBwdDir()) { return(true); } else { return(false); } } else { return(false); } }
public static bool IsFaceToFace(CellObjCtrl ctrl) { if (ctrl == null || ctrl._TgtObj == null) { return(false); } bool bFwdFriend = CellObjCtrlUtils.IsNbSameCamp(ctrl, 0); if (bFwdFriend) { CellObjCtrl fwdCtrl = GetNbCellObjCtrl(ctrl, 0); if (fwdCtrl.GetDir() == ctrl.GetBwdDir()) { return(true); } else { return(false); } } else { return(false); } }
void OperateBwdAnteller( HexCoord hc, MiroV1ModelSetting mSetThis, MiroModelV1 model) { int DirBwd = _cellCtrl.GetBwdDir(); bool bBwd = CheckValidInDir(mSetThis, hc, DirBwd); ChangeAnteller(bBwd, model._Antellers [1]); }