Ejemplo n.º 1
0
 public static T DefFromNodeUnsafe <T>(XmlNode subNode)
 {
     return((T)((object)GenGeneric.InvokeStaticGenericMethod(typeof(ScribeExtractor), typeof(T), "DefFromNode", new object[]
     {
         subNode
     })));
 }
Ejemplo n.º 2
0
        public static Graphic Get(Type graphicClass, string path, Shader shader, Vector2 drawSize, Color color, Color colorTwo, GraphicData data)
        {
            GraphicRequest graphicRequest = new GraphicRequest(graphicClass, path, shader, drawSize, color, colorTwo, data, 0);

            if (graphicRequest.graphicClass == typeof(Graphic_Single))
            {
                return(GraphicDatabase.GetInner <Graphic_Single>(graphicRequest));
            }
            if (graphicRequest.graphicClass == typeof(Graphic_Terrain))
            {
                return(GraphicDatabase.GetInner <Graphic_Terrain>(graphicRequest));
            }
            if (graphicRequest.graphicClass == typeof(Graphic_Multi))
            {
                return(GraphicDatabase.GetInner <Graphic_Multi>(graphicRequest));
            }
            if (graphicRequest.graphicClass == typeof(Graphic_Mote))
            {
                return(GraphicDatabase.GetInner <Graphic_Mote>(graphicRequest));
            }
            if (graphicRequest.graphicClass == typeof(Graphic_Random))
            {
                return(GraphicDatabase.GetInner <Graphic_Random>(graphicRequest));
            }
            if (graphicRequest.graphicClass == typeof(Graphic_Flicker))
            {
                return(GraphicDatabase.GetInner <Graphic_Flicker>(graphicRequest));
            }
            if (graphicRequest.graphicClass == typeof(Graphic_Appearances))
            {
                return(GraphicDatabase.GetInner <Graphic_Appearances>(graphicRequest));
            }
            if (graphicRequest.graphicClass == typeof(Graphic_StackCount))
            {
                return(GraphicDatabase.GetInner <Graphic_StackCount>(graphicRequest));
            }
            try
            {
                return((Graphic)GenGeneric.InvokeStaticGenericMethod(typeof(GraphicDatabase), graphicRequest.graphicClass, "GetInner", new object[]
                {
                    graphicRequest
                }));
            }
            catch (Exception ex)
            {
                Log.Error(string.Concat(new object[]
                {
                    "Exception getting ",
                    graphicClass,
                    " at ",
                    path,
                    ": ",
                    ex.ToString()
                }));
            }
            return(BaseContent.BadGraphic);
        }
Ejemplo n.º 3
0
 public WeatherWorker(WeatherDef def)
 {
     this.def = def;
     foreach (Type current in def.overlayClasses)
     {
         SkyOverlay item = (SkyOverlay)GenGeneric.InvokeStaticGenericMethod(typeof(WeatherPartPool), current, "GetInstanceOf");
         this.overlays.Add(item);
     }
     this.skyTargets[0] = new WeatherWorker.SkyThreshold(def.skyColorsNightMid, 0f);
     this.skyTargets[1] = new WeatherWorker.SkyThreshold(def.skyColorsNightEdge, 0.1f);
     this.skyTargets[2] = new WeatherWorker.SkyThreshold(def.skyColorsDusk, 0.6f);
     this.skyTargets[3] = new WeatherWorker.SkyThreshold(def.skyColorsDay, 1f);
 }