zoukankan      html  css  js  c++  java
  • 极其不想继承你


    //首先,用户ID竟然是字符串型,数据库里存的是BIGINT型吧,就算用户登陆名不是纯数字 ,那他在数据库里也有一个bigint型数据
    private string userid;
    public GameTable AddTable(string tableId)
            {
    //桌子列表用的是字典,一个游戏(比如QQ游戏的象棋),每次添加一个桌子我要判断几K次,况且字典又费内存
    //为什么不设置成自增的桌号??
                if (tableList.ContainsKey(tableId))
                    return tableList[tableId];
     //每次添加桌子还要从配置文件中取一次类名,不知道这个配置是只加载一次到内存还是每次打开

                string className = ConfigurationManager.AppSettings[gameName];
                Assembly asmb = Assembly.LoadFrom(className);

                string typeName = ConfigurationManager.AppSettings[gameName + "GameTable"];
                Type t = asmb.GetType(typeName);

                GameTable table = (GameTable)Activator.CreateInstance(t, new object[] { tableId });
                tableList.Add(tableId, table);
                return table;
            }
          写的不是程序,是寂寞

  • 相关阅读:
    判断一个数是否为素数的方法
    什么是算法?
    table 表格
    状态模式
    设计模式
    观察者模式
    async函数
    JS单线程和异步
    ES6 --- Promise
    浅析flex 布局
  • 原文地址:https://www.cnblogs.com/yangyh/p/1541554.html
Copyright © 2011-2022 走看看