Ejemplo n.º 1
0
		public float GetRate(Resource resource)
		{
			//According to http://www.factorioforums.com/wiki/index.php?title=Mining_drill
			return (MiningPower - resource.Hardness) * Speed / resource.Time;
		}
Ejemplo n.º 2
0
		private static void InterpretResource(String name, LuaTable values)
		{
			Resource newResource = new Resource(name);
			newResource.Category = values["category"] as String;
			if (String.IsNullOrEmpty(newResource.Category))
			{
				newResource.Category = "basic-solid";
			}
			LuaTable minableTable = values["minable"] as LuaTable;
			newResource.Hardness = Convert.ToSingle(minableTable["hardness"]);
			newResource.Time = Convert.ToSingle(minableTable["mining_time"]);

			if (minableTable["result"] != null)
			{
				newResource.result = minableTable["result"] as String;
			}
			else
			{
				newResource.result = ((minableTable["results"] as LuaTable)[1] as LuaTable)["name"] as String;
			}

			Resources.Add(name, newResource);
		}