示例#1
0
        partial void pAddOverlay(ScriptOverlay overlay)
        {
            if (string.IsNullOrWhiteSpace(overlay.CodeName))
            {
                throw new ArgumentException("CodeName of ScriptOverlay is null or white space!");
            }

            ovNames.Add(overlay.CodeName, overlay);
        }
示例#2
0
        public bool TryGetOverlay(string codeName, out ScriptOverlay ov)
        {
            if (codeName == null)
            {
                ov = null;
                return(false);
            }

            return(ovNames.TryGetValue(codeName, out ov));
        }
示例#3
0
        /// <summary>
        /// Create ScriptOverlay-objects from database table and output them as Dictionary overlayByID.
        /// </summary>
        /// <param name="dataTable"></param>
        /// <param name="overlayByID"></param>
        /// <returns></returns>
        public bool TryGenerateScriptOverlays(List <List <object> > dataTable,
                                              out Dictionary <int, ScriptOverlay> overlayByID)
        {
            overlayByID = new Dictionary <int, ScriptOverlay>();

            List <ColumnGetTypeInfo> info;

            TryGetColGetTypeInfo("ScriptOverlay", out info);

            try
            {
                foreach (List <object> row in dataTable)
                {
                    var overlay = new ScriptOverlay();
                    var id      = -1;
                    for (int c = 0; c < row.Count; c++)
                    {
                        switch (info[c].colName)
                        {
                        case "ScriptOverlayID":
                            id = (int)row[c];
                            break;

                        case "CodeName":
                            overlay.CodeName = (string)row[c];
                            break;

                        case "ScriptOverlayName":
                            overlay.Name = (string)row[c];
                            break;
                        }
                    }
                    if (id < 0)
                    {
                        throw new Exception("No ScriptOverlayID found in db-data.");
                    }
                    overlayByID.Add(id, overlay);
                }
            }
            catch (Exception ex)
            {
                info = null;
                MakeLogError(ex);
                return(false);
            }

            return(true);
        }
示例#4
0
 public void RemoveOverlay(ScriptOverlay overlay)
 {
     this.baseDef.RemoveOverlay(overlay.BaseOverlay);
     pRemoveOverlay(overlay);
 }
示例#5
0
 partial void pRemoveOverlay(ScriptOverlay overlay);
示例#6
0
 public void AddOverlay(ScriptOverlay overlay)
 {
     this.baseDef.AddOverlay(overlay.BaseOverlay);
     pAddOverlay(overlay);
 }
示例#7
0
 partial void pAddOverlay(ScriptOverlay overlay);
示例#8
0
 public virtual void AddOverlayAni(ScriptAni ani, ScriptOverlay ov)
 {
     this.baseAniJob.AddOverlayAni(ani.BaseAni, ov.BaseOverlay);
 }
示例#9
0
 public void RemoveOverlay(ScriptOverlay overlay)
 {
     this.BaseInst.RemoveOverlay(overlay.BaseOverlay);
 }
示例#10
0
 public void ApplyOverlay(ScriptOverlay overlay)
 {
     this.BaseInst.ApplyOverlay(overlay.BaseOverlay);
 }
示例#11
0
 partial void pRemoveOverlay(ScriptOverlay overlay)
 {
     ovNames.Remove(overlay.CodeName);
 }