コード例 #1
0
ファイル: Program.cs プロジェクト: Memhave/Chat-System
        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();
        }
コード例 #2
0
ファイル: Observer.cs プロジェクト: Memhave/Chat-System
 public Observer(string name, ChatSystem chat, ModelManager model)
 {
     this.model = model;
     this.ObserverName = name;
     this.chat = chat;
 }
コード例 #3
0
ファイル: Controller.cs プロジェクト: Memhave/Chat-System
 public Controller(ModelManager model, ChatSystem chatSystem)
 {
     this.chat = chatSystem;
     this.modelManager = model;
 }
コード例 #4
0
ファイル: Game1.cs プロジェクト: RoyLiuGitHub/GameProgramming
        /// <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();
        }