public bool CheckIdentity(EBehaviorType behaviorType, bool remind = true) { switch (behaviorType) { case EBehaviorType.SaveRecordData: case EBehaviorType.CreateRecord: if (_account.UserType > EUserType.Guest) { return(true); } break; case EBehaviorType.ChangeRoomData: case EBehaviorType.ChangePayType: case EBehaviorType.DeleteAllData: if (_account.UserType == EUserType.AdminLeve2) { return(true); } break; case EBehaviorType.UpdateRecord: case EBehaviorType.DeleteRecord: if (_account.UserType > EUserType.AdminLeve0) { return(true); } break; default: throw new ArgumentOutOfRangeException("behaviorType", behaviorType, null); } if (remind) { switch (behaviorType) { case EBehaviorType.SaveRecordData: SocialGUIManager.ShowPopupDialog("您没有权限修改订单数据"); break; case EBehaviorType.ChangeRoomData: SocialGUIManager.ShowPopupDialog("您没有权限修改房间数据"); break; case EBehaviorType.ChangePayType: SocialGUIManager.ShowPopupDialog("您没有权限修改付款类型数据"); break; case EBehaviorType.DeleteAllData: SocialGUIManager.ShowPopupDialog("您没有权限修删除所有数据"); break; case EBehaviorType.CreateRecord: SocialGUIManager.ShowPopupDialog("您没有权限创建订单"); break; case EBehaviorType.UpdateRecord: SocialGUIManager.ShowPopupDialog("您没有权限修改订单"); break; case EBehaviorType.DeleteRecord: SocialGUIManager.ShowPopupDialog("您没有权限删除订单"); break; default: throw new ArgumentOutOfRangeException("behaviorType", behaviorType, null); } } return(false); }
public Behavior(EBehaviorType type, Brain brain, Unit self) { _type = type; _brain = brain; _self = self; }