static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); ClientSocket client = new ClientSocket(); ModelManager model = new ModelManager(client); ChatSystem chat = new ChatSystem("Client"); Observer observer=new Observer("Observer", chat, model); Controller controller = new Controller(model, chat); Application.Run(new Login(controller)); //Mistake this call will go into a a loop which first leaves it when closing the GUI. First then it connects to the server //with the last 2 method calls. client.setObserver(observer); client.Loopconnect(); }
public Observer(string name, ChatSystem chat, ModelManager model) { this.model = model; this.ObserverName = name; this.chat = chat; }
public Controller(ModelManager model, ChatSystem chatSystem) { this.chat = chatSystem; this.modelManager = model; }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { // TODO: Add your initialization logic here //camera = new Camera(this, cameraPosition, new Vector3(0, 25, 0), Vector3.Up); //camera = new Camera(this, new Vector3(0, 2500, 500), new Vector3(500, 200, 500), Vector3.Up); //camera = new Camera(this, new Vector3(0, 1500, 4000),new Vector3(0, 0, 3000), Vector3.Up); camera = new Camera(this, new Vector3(-200, 3200, -3000), new Vector3(-200, 0, 500), Vector3.Up); Components.Add(camera); modelManager = new ModelManager(this); Components.Add(modelManager); this.IsMouseVisible = true; base.Initialize(); }