/// <summary> /// replaces returning the old value - not especially usefull /// </summary> /// <param name="num"></param> /// <param name="r"></param> /// <returns></returns> public RC_Renderable replace(int num, RC_Renderable r) { RC_Renderable retv = rlist[num]; rlist[num] = r; return(retv); }
/// <summary> /// Copy constructor dont know if it will ever be used since its a parent class /// </summary> public RC_Renderable(RC_Renderable r) { active = r.active; visible = r.visible; colour = r.colour; tag = r.tag; tagInt = r.tagInt; }
/// <summary> /// Copy constructor dont know if it will ever be used since its a parent class /// </summary> public RC_Renderable(RC_Renderable r) { active = r.active; visible = r.visible; colour = r.colour; tag = r.tag; tagInt = r.tagInt; dragAndDrop = false; }
/// <summary> /// standard way to add things to the list reusing old space to /// stop the list growing to long /// </summary> /// <param name="r"></param> public void addReuse(RC_Renderable r) { int i = findInactive(); if (i == -1) { rlist.Add(r); } else { rlist[i] = r; } }
/// <summary> /// This returns the index of the next renderable /// in most cases it makes no senseits probably only usefull in gui applications /// it assumes the renderables are placed in the list an a meaningfull order /// </summary> /// <param name="item"></param> /// <returns></returns> public int IndexOfNext(RC_Renderable item) { int retv = rlist.IndexOf(item); if (retv < 0) { return(retv); } if (retv == rlist.Count - 1) { return(rlist.Count - 1); } return(retv + 1); }
/// <summary> /// This returns the index of the previous renderable /// in most cases it makes no senseits probably only usefull in gui applications /// it assumes the renderables are placed in the list an a meaningfull order /// </summary> /// <param name="item"></param> /// <returns></returns> public int IndexOfPrevious(RC_Renderable item) { int retv = rlist.IndexOf(item); if (retv < 0) { return(retv); } if (retv == 0) { return(0); } return(retv - 1); }
/// <summary> /// gets a renderable i /// </summary> /// <param name="i"></param> /// <returns></returns> public RC_Renderable getRenderable(int i) { RC_Renderable retv = rlist[i]; return(retv); }
/// <summary> /// Adds to the list - fast but usually we would use the 'addReuse' method /// </summary> /// <param name="r"></param> public void addToEnd(RC_Renderable r) { rlist.Add(r); }
/// <summary> /// This returns the index of a given renderable /// </summary> /// <param name="item"></param> /// <returns></returns> public int IndexOf(RC_Renderable item) { return(rlist.IndexOf(item)); }