SHARE
TWEET

Untitled

temperufka Jul 17th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class ExampleBuildSystemProvider : IBuildSystemProvider
  2. {
  3.  
  4.     private IRoomFactoryProvider m_roomFactoryProvider;
  5.     private IGridManagerProvider m_gridManagerProvider;
  6.     private ISelectorManagerPovider m_selectorManagerProvider;
  7.  
  8.     public ExampleBuildSystemProvider(IGridManagerProvider gridManagerProvider,IRoomFactoryProvider roomFactoryProvider, ISelectorManagerProvider selectorManagerProvider)
  9.     {
  10.         m_gridManagerProvider = gridManagerProvider;
  11.         m_roomFactoryProvider = roomFactoryProvider;
  12.         m_selectorManagerProvider = selectorManagerProvider;
  13.     }
  14.  
  15.  
  16.     public void BuildRoom(RoomData roomData)
  17.     {
  18.         m_roomFactoryProvider.BuildRoom(RoomData); // Instanting and initializing new room
  19.         m_gridManagerProvider.RegisterAtGrid(roomData.ID);
  20.         m_selectorManagerProvider.Hide(); // Hide build position selectors
  21.     }
  22.  
  23.     public void RemoveRoom(RoomData roomData)
  24.     {
  25.         m_gridManagerProvider.DeregisterFromGrid(RoomData.ID); //Deregister room from grid, make this tile empty
  26.         m_roomFactoryProvider.RemoveRoom(RoomData); //Delete room from scene, clear room data
  27.         m_selectorManagerProvider.Hide();
  28.     }
  29.  
  30.     public void ReplaceRoom(RoomData roomData)
  31.     {
  32.         m_gridManagerProvider.DeregisterFromGrid(RoomData.ID);
  33.         m_roomFactoryProvider.ReplaceRoom(RoomData);
  34.     }
  35.  
  36. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top