Example #1
1
        /// <summary>
        /// Player constructor.
        /// </summary>
        /// <param name="color"></param>
        public Player(Alliance alliance, Color color, Point startLocation)
        {
            Game1.GetInstance().players.AddLast(this);
            this.device = Game1.GetInstance().GraphicsDevice;
            this.alliance = alliance;
            this.startLocation = startLocation;
            if (!this.alliance.members.Contains(this)) this.alliance.members.AddLast(this);
            this.color = color;

            selectionTex = Game1.GetInstance().Content.Load<Texture2D>("Selection");
            selectedTex = Game1.GetInstance().Content.Load<Texture2D>("Selected");

            units = new CustomArrayList<Unit>();
            buildings = new CustomArrayList<Building>();
            hud = new HUD(this, color);
            resources = 100000;

            meleeStore = new MeleeStore(this);
            rangedStore = new RangedStore(this);
            fastStore = new FastStore(this);

            arrowManager = new ArrowManager();

            lightTexture = Game1.GetInstance().Content.Load<Texture2D>("Fog/Light");

            MouseManager.GetInstance().mouseClickedListeners += ((MouseClickListener)this).OnMouseClick;
            MouseManager.GetInstance().mouseReleasedListeners += ((MouseClickListener)this).OnMouseRelease;
            MouseManager.GetInstance().mouseMotionListeners += ((MouseMotionListener)this).OnMouseMotion;
            MouseManager.GetInstance().mouseDragListeners += ((MouseMotionListener)this).OnMouseDrag;
        }
Example #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         if (!string.IsNullOrEmpty(Request["head"]))
         {
             GridPanel1.TopBar[0].Visible = false;
             if (Request["head"].Trim() == "0")
             {
                 GridPanel1.Header = false;
                 GridPanel1.Height = 160;
                 Window1.Listeners.BeforeShow.Fn = "function(el) { el.setHeight(Ext.getBody().getViewSize().height);el.setWidth(Ext.getBody().getViewSize().width-20); }";
             }
             if (Request["head"].Trim() == "1")
             {
                 GridPanel1.Height = 300;
                 Window1.Listeners.BeforeShow.Fn = "function(el) { el.setHeight(Ext.getBody().getViewSize().height-20);el.setWidth(Ext.getBody().getViewSize().width-20); }";
             }
         }
         dfBegin.SelectedDate = System.DateTime.Today.AddDays(1 - System.DateTime.Today.Day);
         dfEnd.SelectedDate   = System.DateTime.Today;
         dfBegin.MaxDate      = System.DateTime.Today;
         dfEnd.MaxDate        = System.DateTime.Today;
         #region 初始化单位
         DBSCMDataContext dc = new DBSCMDataContext();
         if (SessionBox.GetUserSession().rolelevel.Contains("1") || SessionBox.GetUserSession().rolelevel.Contains("0"))
         {
             var dept = from d in dc.Department
                        where d.Deptnumber.Substring(4) == "00000" && d.Deptname.EndsWith("矿")
                        select new
             {
                 d.Deptname,
                 Deptid = d.Deptnumber
             };
             UnitStore.DataSource = dept;
             UnitStore.DataBind();
             cbbUnit.SelectedItem.Value = "-1";
             cbbUnit.Disabled           = false;
         }
         else
         {
             var dept = from d in dc.Department
                        where d.Deptnumber == SessionBox.GetUserSession().DeptNumber
                        select new
             {
                 d.Deptname,
                 Deptid = d.Deptnumber
             };
             UnitStore.DataSource = dept;
             UnitStore.DataBind();
             cbbUnit.SelectedItem.Value = SessionBox.GetUserSession().DeptNumber;
             cbbUnit.Disabled           = true;
         }
         #endregion
         storebind();
     }
 }
    public void Start()
    {
        scriptManager = GameObject.Find("ScriptManager").GetComponent<ScriptManager>();
        unitstore = scriptManager.unitStore;
        dumbComputer = scriptManager.dumbComputer;
        guiController = scriptManager.guiController;

        addObstacles();

        SetUpPhase();        
    }
 private void BaseLoad()
 {
     UnitStore.DataSource = PublicCode.GetMaindept("");
     UnitStore.DataBind();
     if (SessionBox.GetUserSession().rolelevel.Trim().IndexOf("1") > -1)
     {
         cbbUnit.SelectedItem.Value = "241700000";
         cbbUnit.Disabled           = false;
     }
     else
     {
         cbbUnit.SelectedItem.Value = SessionBox.GetUserSession().DeptNumber;
         cbbUnit.Disabled           = true;
     }
 }
Example #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Ext.IsAjaxRequest)
        {
            dfBegin.SelectedDate = System.DateTime.Today;
            dfEnd.SelectedDate = System.DateTime.Today;
            dfBegin.MaxDate = System.DateTime.Today;
            dfEnd.MaxDate = System.DateTime.Today;

            #region 初始化单位
            DBSCMDataContext dc = new DBSCMDataContext();
            if (SessionBox.GetUserSession().rolelevel.Trim().IndexOf("1") > -1)
            {
                var dept = from d in dc.Department
                           where d.Deptnumber.Substring(4) == "00000" && d.Deptname.EndsWith("矿")
                           select new
                           {
                               d.Deptname,
                               Deptid = d.Deptnumber
                           };
                UnitStore.DataSource = dept;
                UnitStore.DataBind();
                cbbUnit.SelectedItem.Value = "241700000";
                cbbUnit.Disabled = false;

            }
            else
            {
                var dept = from d in dc.Department
                           where d.Deptnumber == SessionBox.GetUserSession().DeptNumber
                           select new
                           {
                               d.Deptname,
                               Deptid = d.Deptnumber
                           };
                UnitStore.DataSource = dept;
                UnitStore.DataBind();
                cbbUnit.SelectedItem.Value = SessionBox.GetUserSession().DeptNumber;
                cbbUnit.Disabled = true;
            }
            #endregion

            LoadData();
        }
    }
Example #6
0
    private void SearchLoad()//查询窗口初始化
    {
        //初始化日期
        df_begin.SelectedDate = System.DateTime.Today.AddDays(-2);
        df_end.SelectedDate   = System.DateTime.Today;
        #region 初始化部门
        var dep = from d in dc.Department
                  from p in dc.Person
                  where d.Deptnumber == p.Areadeptid && p.Maindeptid == SessionBox.GetUserSession().DeptNumber
                  select new
        {
            DeptName = d.Deptname,
            DeptID   = d.Deptnumber
        };
        DeptStore.DataSource = dep;
        DeptStore.DataBind();
        #endregion

        #region 初始化单位
        if (SessionBox.GetUserSession().rolelevel.Trim().IndexOf("1") > -1)
        {
            UnitStore.DataSource = PublicCode.GetMaindept("");
            UnitStore.DataBind();
            cbbUnit.Disabled = false;

            cbb_part.Disabled = true;
        }
        else
        {
            var dept = from d in dc.Department
                       where d.Deptnumber == SessionBox.GetUserSession().DeptNumber
                       select new
            {
                d.Deptname,
                d.Deptnumber
            };
            UnitStore.DataSource = dept;
            UnitStore.DataBind();
            cbbUnit.SelectedItem.Value = SessionBox.GetUserSession().DeptNumber;
            cbbUnit.Disabled           = true;
        }
        #endregion
    }
Example #7
0
    private void SearchLoad()//查询窗口初始化
    {
        //初始化日期
        df_begin.SelectedDate = System.DateTime.Today.AddDays(-15);
        df_end.SelectedDate   = System.DateTime.Today;
        #region 初始化部门
        DeptStore.DataSource = PublicCode.GetKQdept(SessionBox.GetUserSession().DeptNumber);
        DeptStore.DataBind();
        #endregion

        #region 初始化单位
        if (SessionBox.GetUserSession().rolelevel.Trim().IndexOf("1") > -1)
        {
            UnitStore.DataSource = PublicCode.GetMaindept("");
            UnitStore.DataBind();
            cbbUnit.Disabled = false;

            cbb_part.Disabled = true;
        }
        else
        {
            UnitStore.DataSource = PublicCode.GetMaindept(SessionBox.GetUserSession().DeptNumber);
            UnitStore.DataBind();
            cbbUnit.SelectedItem.Value = SessionBox.GetUserSession().DeptNumber;
            cbbUnit.Disabled           = true;
        }
        #endregion
        //三违级别
        var lavel = from c in dc.CsBaseinfoset
                    where c.Fid == int.Parse(PublicMethod.ReadXmlReturnNode("SWJB", this))
                    select new
        {
            SWLevelID = c.Infoid,
            SWLevel   = c.Infoname
        };
        LevelStore.DataSource = lavel;
        LevelStore.DataBind();
    }
Example #8
0
    private void SearchLoad()//查询窗口初始化
    {
        //初始化日期
        df_begin.SelectedDate = System.DateTime.Today;
        df_end.SelectedDate   = System.DateTime.Today;
        //df_begin.SelectedDate = System.DateTime.Today;//.AddDays(-1);
        //df_end.SelectedDate = System.DateTime.Today;
        #region 初始化职务
        var pos = from p in dc.Position
                  from per in dc.Person
                  where p.Posid == per.Posid && per.Maindeptid == SessionBox.GetUserSession().DeptNumber
                  select new
        {
            p.Posid,
            p.Posname
        };
        Store3.DataSource = pos;
        Store3.DataBind();
        #endregion

        #region 初始化部门
        //var dep = from d in dc.Department
        //          where d.Fatherid == SessionBox.GetUserSession().DeptNumber
        //          select new
        //          {
        //              d.Deptname,
        //              Deptid = d.Deptnumber
        //          };
        //DeptStore.DataSource = dep;
        //DeptStore.DataBind();

        var dep = from d in dc.Department
                  from p in dc.Person
                  where d.Deptnumber == p.Areadeptid && p.Maindeptid == SessionBox.GetUserSession().DeptNumber
                  select new
        {
            d.Deptname,
            Deptid = d.Deptnumber
        };
        DeptStore.DataSource = dep;
        DeptStore.DataBind();

        #endregion

        #region 初始化单位
        if (SessionBox.GetUserSession().rolelevel.Trim().IndexOf("1") > -1)
        {
            var dept = from d in dc.Department
                       where d.Deptnumber.Substring(4) == "00000" && d.Deptname.EndsWith("矿")
                       select new
            {
                d.Deptname,
                Deptid = d.Deptnumber
            };
            UnitStore.DataSource = dept;
            UnitStore.DataBind();
            cbbUnit.Disabled = false;

            cbb_position.Disabled = true;
            cbb_person.Disabled   = true;
            cbb_part.Disabled     = true;
            cbb_status.Disabled   = true;
        }
        else
        {
            var dept = from d in dc.Department
                       where d.Deptnumber == SessionBox.GetUserSession().DeptNumber
                       select new
            {
                d.Deptname,
                Deptid = d.Deptnumber
            };
            UnitStore.DataSource = dept;
            UnitStore.DataBind();
            cbbUnit.SelectedItem.Value = SessionBox.GetUserSession().DeptNumber;
            cbbUnit.Disabled           = true;
        }
        #endregion

        //#region 初始化级别
        //var lavel = from l in dc.Yinhuanlevel
        //            select new
        //                {
        //                    l.YHLevelID,
        //                    l.YHLevel
        //                };
        //LevelStore.DataSource = lavel;
        //LevelStore.DataBind();
        //#endregion

        #region 初始化类型
        int zyID = int.Parse(PublicMethod.ReadXmlReturnNode("ZY", this));

        var type = from t in dc.CsBaseinfoset
                   where t.Fid == zyID
                   select new
        {
            YHTypeID = t.Infoid,
            YHType   = t.Infoname
        };
        TypeStore.DataSource = type;
        TypeStore.DataBind();
        #endregion

        #region 初始化状态
        StatusStore.DataBind();
        #endregion
    }