| 
									
										
										
										
											2022-07-02 21:23:45 +08:00
										 |  |  | using System; | 
					
						
							|  |  |  | using System.IO; | 
					
						
							|  |  |  | using System.Collections.Generic; | 
					
						
							|  |  |  | using System.Linq; | 
					
						
							|  |  |  | using System.Text; | 
					
						
							|  |  |  | using System.Threading.Tasks; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace BallanceStalkerCore { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-07-21 00:23:20 +08:00
										 |  |  |     public enum EventControllerSource { | 
					
						
							|  |  |  |         /// <summary> | 
					
						
							|  |  |  |         /// Default statue. It mean that we are now in camera mode. | 
					
						
							|  |  |  |         /// </summary> | 
					
						
							|  |  |  |         None, | 
					
						
							|  |  |  |         /// <summary> | 
					
						
							|  |  |  |         /// Menu take control of event input | 
					
						
							|  |  |  |         /// </summary> | 
					
						
							|  |  |  |         Menu, | 
					
						
							|  |  |  |         /// <summary> | 
					
						
							|  |  |  |         /// Console panel now take control of event input. | 
					
						
							|  |  |  |         /// </summary> | 
					
						
							|  |  |  |         Console, | 
					
						
							|  |  |  |         /// <summary> | 
					
						
							|  |  |  |         /// it is same as console, the only different is preset character | 
					
						
							|  |  |  |         /// </summary> | 
					
						
							|  |  |  |         Chat | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-07-02 21:23:45 +08:00
										 |  |  |     public class StalkerManager { | 
					
						
							|  |  |  |         public static StalkerManager Singleton = new StalkerManager(); | 
					
						
							|  |  |  |         private StalkerManager() { | 
					
						
							| 
									
										
										
										
											2022-07-21 00:23:20 +08:00
										 |  |  |             mEventController = EventControllerSource.None; | 
					
						
							| 
									
										
										
										
											2022-07-02 21:23:45 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-07-21 00:23:20 +08:00
										 |  |  |             mLogger = new LogManager(); | 
					
						
							|  |  |  |             mBmmoClient = new BmmoClient(mLogger); | 
					
						
							| 
									
										
										
										
											2022-07-02 21:23:45 +08:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-07-21 00:23:20 +08:00
										 |  |  |         public event Action<EventControllerSource> EventControllerChanged; | 
					
						
							|  |  |  |         private EventControllerSource mEventController; | 
					
						
							| 
									
										
										
										
											2022-07-02 21:23:45 +08:00
										 |  |  |         public BmmoClient mBmmoClient; | 
					
						
							|  |  |  |         public LogManager mLogger; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-07-21 00:23:20 +08:00
										 |  |  |         public void SetEventController(EventControllerSource src) { | 
					
						
							|  |  |  |             if (mEventController != src) { | 
					
						
							|  |  |  |                 mEventController = src; | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |             EventControllerChanged?.Invoke(src); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         public EventControllerSource GetEventController() { | 
					
						
							|  |  |  |             return mEventController; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-07-02 21:23:45 +08:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } |