public static Task.BaseInfo Get(int id, int childid) { DailyTaskData data = Get(id); if (data != null && data.taskList.Count >= childid) { return(data.taskList[childid - 1]); } else { ALog.logError(string.Format("Daily Task Error: doesnt has ID:{0},childID:{1}!", id, childid)); } return(null); }
public static DungeonWar Get(int id) { DungeonWar war = null; if (!dataMap.TryGetValue(id, out war)) { string filepath = "data/xml/dugeonWar/section_" + id.ToString(); war = AResource.LoadXML <DungeonWar>(filepath); if (war != null) { dataMap.Add(id, war); } else { ALog.logError(filepath + " doesnot exist!"); } } return(war); }
public override void unserialize(MemoryStream stream) { base.unserialize(stream); byte[] bmessageid = new byte[4]; stream.Read(bmessageid, 0, 4); messageid = BitConverter.ToUInt32(bmessageid, 0); byte[] bsize = new byte[4]; stream.Read(bsize, 0, 4); size = BitConverter.ToUInt32(bsize, 0); try { data = new byte[size]; stream.Read(data, 0, (int)size); } catch (Exception ex) { ALog.logError(ex.Message); } }