behavior tree – is there any different solution for different buildings different behaviours

 class agricultural{
     Workr Work
     void Working(Work W){
         Behaviour1();
     }
 }
 class Carpentry{
     Workr Work
     void Working(Work W){
         Behaviour2();
     }
 }
 template <tipename T> class BuildWork{
     T BW
     Work(){
         BW.Working();
     }
 }

something like that but problem occurs as when I would wont to declare template

 class Workr{
     // here I would need to make it only for 1 is possible
     BuildWork <agricultural> BW
 }

so this is no use or is it?

so next thing occured to me is this

 class Building{
     bool beh(2);
     void Work(Workr W){
         if beh(0){
             if (beh(1)){
                 behaviour0(Workr W);
             }
             else{
                 behaviour1(Workr W);
             }
         }
         else{
             if (beh(1)){
                 behaviour2(Workr W);
             }
             else{
                  behaviour3(Workr W);
             }
         }
     }
 }

the last code is workable but I wander if there is any better solution to be made thanks

PS. if code isn’t logically made I’m sorry as I cam only use hospital’s computer and I’m programming with pencil on a piece of papres