Beispiel #1
0
    public GameObject SpawnAnNPC(string type, Vector2 pos = default(Vector2))
    {
        GameObject npcinst = Instantiate(NPCPref, pos, Quaternion.identity, transform);

        switch (type)
        {
        case "student":
            student std = npcinst.AddComponent <student> ();
            std.ChangeColour(Color.gray);
            break;

        case "teacher":
            teacher teach = npcinst.AddComponent <teacher> ();
            teach.ChangeColour(Color.green);
            break;

        case "officestaff":
            officestaff of = npcinst.AddComponent <officestaff> ();
            of.ChangeColour(Color.blue);
            break;

        case "cleaner":
            cleaner cln = npcinst.AddComponent <cleaner>();
            cln.ChangeColour(Color.magenta);
            break;

        default:
            npc NPC = npcinst.AddComponent <npc>();
            NPC.ChangeColour(Color.yellow);
            break;
        }
        NPCs.Add(npcinst.GetComponent <npc>());
        return(npcinst);
    }
Beispiel #2
0
 public Form1()
 {
     InitializeComponent();
     Printer     = new printer(print);
     Cleaner     = new cleaner(clearChat);
     CleanerList = new cleanerList(clearList);
     PrinterList = new printerList(printList);
 }
 public MainClient()
 {
     InitializeComponent();
     Printer = new printer(print);
     Cleaner = new cleaner(clearChat);
     connect();
     _clientThread = new Thread(listner);
     _clientThread.IsBackground = true;
     _clientThread.Start();
 }
Beispiel #4
0
 public ChatForm()
 {
     InitializeComponent();
     Printer    = new printer(print);
     Cleaner    = new cleaner(clearChat);
     Enabler    = new enabler(toggleObj);
     connection = new Connection("", 9933);
     connection.ReceivingUsers    += updateOnline;
     connection.ReceivingMessages += updateChat;
     connection.OnDisconnect      += onDisconnect;
 }
Beispiel #5
0
 public Form1()
 {
     InitializeComponent();
     Printer           = new printer(print);
     Cleaner           = new cleaner(clearChat);
     chat_msg.Enabled  = false;
     chat_send.Enabled = false;
     //connect();
     //_clientThread = new Thread(listner);
     //_clientThread.IsBackground = true;
     //_clientThread.Start();
 }
Beispiel #6
0
        public chatForm()
        {
            InitializeComponent();
            Printer    = new printer(print);
            Cleaner    = new cleaner(clearChat);
            UPrint     = new UserPrinter(UpdateOnlineList);
            bw.DoWork += new DoWorkEventHandler(bw_setName);

            connect();
            UserThread = new Thread(listner);
            UserThread.IsBackground = true;
            UserThread.Start();
        }
Beispiel #7
0
 private void Connection() // подключение к серверу
 {
     // создаем экземпляры делегатов
     Printer            = new printer(Print);
     PrinterOnlineUsers = new printer(PrintOnlineUsers);
     Cleaner            = new cleaner(ClearChat);
     CleanerOnlineUsers = new cleaner(ClearOnlineUsers);
     _connection        = Connect();          // конектимся к серверу
     _clientThread      = new Thread(Listner) // запускаем прослушиваение в потоке
     {
         IsBackground = true                  // делаем поток фоновым
     };
     _clientThread.Start();                   // запускаем поток
 }
        public Form1()
        {
            InitializeComponent();

            Printer      = new printer(print);
            Cleaner      = new cleaner(clearDbView);
            CreateMsgBox = new createMsgBox(msgBox);

            connect();
            _clientThread = new Thread(listner);
            _clientThread.IsBackground = true;
            _clientThread.Start();

            send("#refreshview");
        }
Beispiel #9
0
        public ChatForm(Account user, MySQLConnection con, MainMenu main_menu, User companion_)
        {
            string Host = Dns.GetHostName();
            string IP   = Dns.GetHostByName(Host).AddressList[0].ToString();//Определение IP-адреса сервера StudChatServer

            server_host  = IP;
            your_account = user;
            connection   = con;
            menu         = main_menu;
            companion    = companion_;
            InitializeComponent();
            name    = your_account.name + " " + your_account.surname + "(" + your_account.nickname + ")";
            Printer = new printer(Print);
            Cleaner = new cleaner(ClearChat);
            //Создание соединения с сервером
            Connection();
            //Запуск соединения с сервером через поток
            client_thread = new Thread(Listener);
            client_thread.IsBackground = true;
            client_thread.Start();
        }
Beispiel #10
0
 public chatForm()
 {
     InitializeComponent();
     Printer = new printer(print);
     Cleaner = new cleaner(clearChat);
 }