private void UpdateCampCreate(int camp, GameObject copy) { AWBuildingBarrack buildingBarrack = AWCore.Instance.GetGame().GetScene <AWSceneHome>().GetAWBuilding <AWBuildingBarrack>(m_building); IBuildingConfItem buildingConfItem = AW.GetSingleton <IDataAdapter>().GetBuildingConfItem(m_building); List <int> produceUnitLists = AW.GetSingleton <IDataAdapter>().GetProduceUnitList(m_building.GetBuildingType()); Dictionary <int, Camp> produceTroops = barrack.GetProduceTroopDic(); copy.transform.SetParent(campAnchor, false); copy.GetComponent <UISetAnchor>().SetAnchor(buildingBarrack.GetModelAnchor(camp), UIAnchorType.World3DToUI2D); UICampItem campItem = copy.GetComponent <UICampItem>(); campItem.InitCamp(produceTroops, camp, buildingConfItem); campItem.SetUnitName(); campItem.SetSelect(false); itemList.Add(campItem); Button button = copy.GetComponent <Button>(); button.onClick.RemoveAllListeners(); button.onClick.AddListener(CloseUnitList); button.onClick.AddListener(ResetCampItem); button.onClick.AddListener(new OnClickCampEvent(construction, troopsInfoAnchor, produceTroops[camp], replaceUnitList, produceUnitLists, m_building, replaceUnitListAnchor, campItem).OnClickCreateTroopsInfo); m_buildingProcess = copy.ExtGetMissingComponent <AWBuildingProcess>(); m_buildingProcess.InitProcess(produceTroops[camp], copy.transform, new Vector3(-20, 80, 0), UIAnchorType.UI2DToUI2D); m_buildingProcess.SetShow(true); }
public static string CreateAW() { string tmpUrl = ""; List <AW> list = new List <AW>(); AW aw = new AW(); List <Record> record = new List <Record>(); List <Element> element = new List <Element>(); for (int i = 0; i < MainWindow.lbox.Items.Count; i++) { ListBoxItem item = (ListBoxItem)MainWindow.lbox.Items[i]; string jsonData = item.Tag.ToString(); var AWItem = Newtonsoft.Json.JsonConvert.DeserializeObject <List <AW> >(jsonData); if (AWItem[0].record[0].fullUrl != tmpUrl) { tmpUrl = AWItem[0].record[0].fullUrl; aw = AWItem[0]; record.Add(AWItem[0].record[0]); } else { tmpUrl = AWItem[0].record[0].fullUrl; record[record.Count - 1].elements.Add(AWItem[0].record[0].elements[0]); } aw.record = record; } list.Add(aw); awjson = JsonConvert.SerializeObject(list).Replace(":null", ":\"\""); return(ConvertJsonString(awjson)); }
static void Main(string[] args) { using (var db = new AW()) { var e = db.Employees.First(); e.JobTitle = "Web Developper"; db.SaveChanges(); } }
//! 获取科技树分列 public List <int> GetUnitTreeColumn(int unitTreeId) { List <int> column = new List <int>(); for (int i = GetUnitTreeStartLv(unitTreeId); i <= AW.GetSingleton <IDataAdapter>().GetCurCommandConfItem().GetMaxLevel(); i++) { column.Add(i); } return(column); }
public void InitProduce() { construction.onClick.RemoveAllListeners(); construction.onClick.AddListener(OnClickConstruction); if (AW.GetSingleton <IDataAdapter>().GetIdleCamp(barrack)) { construction.gameObject.SetActive(true); } else { construction.gameObject.SetActive(false); } }
private int GetUnitTreeStartLv(int unitTreeId) { if (!m_startLvIndex.ContainsKey(unitTreeId)) { int startlv = int.MaxValue; foreach (int unitId in GetUnitTreeLine(unitTreeId)) { IUnit2ConfItem confItem = AW.GetSingleton <IDataAdapter>().GetUnit2ConfItem(unitId, 1); startlv = Mathf.Min(startlv, confItem.GetUnlockCommandLevel()); } m_startLvIndex.Add(unitTreeId, startlv); } return(m_startLvIndex[unitTreeId]); }
// The return type can be changed to IEnumerable, however to support // paging and sorting, the following parameters must be added: // int maximumRows // int startRowIndex // out int totalRowCount // string sortByExpression public IQueryable <DemoWebForms.Models.Country> grdPays_GetData([Control] string txtFiltre) { AW db = new AW(); if (string.IsNullOrEmpty(txtFiltre)) { return(db.Countries); } else { return(from country in db.Countries where country.Name.StartsWith(txtFiltre) select country); } }
public void InitOrUpdateUnitList() { InitProduce(); Barrack barrack = m_building as Barrack; Dictionary <int, Camp> produceTroops = barrack.GetProduceTroopDic(); //AW.GetSingleton<IDataAdapter>().GetBuildingConfItem(barrack).GetCampVolume(); List <int> produceUnitLists = AW.GetSingleton <IDataAdapter>().GetProduceUnitList(m_building.GetBuildingType()); unitList.InitOrUpdateUnitList(produceUnitLists, m_building, unitListItemAnchor); if (campLists != null) { campLists.Clear(); } campLists.AddRange(produceTroops.Keys); campLists.Sort(); itemList.Clear(); m_campCopy.UpdateCopy(campLists.Count, UpdateCampCopy); }
public void OnClickCreateTroopsInfo() { m_campItem.SetSelect(true); UIWindowTroopsInfo info = UIWindowWrapper.GetWindowAddMask <UIWindowTroopsInfo>(); info.transform.SetParent(m_troopsAnchor, false); info.Open(m_camp); IUnitConfItem unitConfItem = AW.GetSingleton <IDataAdapter>().GetOwnedUnitConfItem(m_camp.ProduceItem); IBuildingConfItem buildingConfItem = AW.GetSingleton <IDataAdapter>().GetBuildingConfItem(m_building); m_count = buildingConfItem.GetTroopCostVolume() / unitConfItem.GetCapacityCost(); Building barrck = (Building)m_camp; if (barrck.GetState() == AWEnum.BuildingStateType.Produce) { info.replace.gameObject.SetActive(false); info.SetCompleteButtonStyle(OnClickComplete); info.SetCancelButtonStle(OnClickCancel); if (m_camp.GetProducedCount() < m_count) { info.SetSupplementButtonStyle(OnClickSupplement); } else { info.supplement.gameObject.SetActive(false); } } else { info.complete.gameObject.SetActive(false); info.cancel.gameObject.SetActive(false); if (m_camp.GetProducedCount() < m_count) { info.SetSupplementButtonStyle(OnClickSupplement); info.SetReplaceButtonStyle(OnClickReplace); } else { info.supplement.gameObject.SetActive(false); info.SetReplaceButtonStyle(OnClickReplace); } } info.SetRename(OnClickRename); }
public Dictionary <int, List <IUnit2ConfItem> > GetUnitTreeNode(int unitTreeId) { if (!m_unitTreeNodeIndex.ContainsKey(unitTreeId)) { List <int> lines = GetUnitTreeLine(unitTreeId); Dictionary <int, List <IUnit2ConfItem> > unitTreeLineIndex = new Dictionary <int, List <IUnit2ConfItem> >(); foreach (int unitId in lines) { List <IUnit2ConfItem> items = new List <IUnit2ConfItem>(); IUnit2ConfItem item = AW.GetSingleton <IDataAdapter>().GetUnit2ConfItem(unitId, 1); do { items.Add(item); item = item.GetUpLevelItem(); }while (item != null); unitTreeLineIndex.Add(unitId, items); } m_unitTreeNodeIndex.Add(unitTreeId, unitTreeLineIndex); } return(m_unitTreeNodeIndex[unitTreeId]); }
private void OnClickCancel() { Debug.Log("OnClickCancel"); AWCore.Instance.GetControl().PostEvent(new CancelUnitEvent(m_camp, AW.GetSingleton <IDataAdapter>().GetServerTime(), CallBack)); }
static extern int AnimateWindow(IntPtr hWnd, int dwTime = 200, AW dwFlags = AW.Center);
public static extern bool AnimateWindow(IntPtr hwnd, uint dwTime, AW dwFlags);
public static extern Boolean AnimateWindow(IntPtr hWnd, uint dwTime, AW dwFlags);