public EventManager(asd.Scene scene) { this.scene = scene; List<asd.Layer> layers = scene.Layers.ToList(); mainLayer = layers[0] as asd.Layer2D; subLayer = layers[1] as asd.Layer2D; }
/// <summary> /// コンストラクタ /// </summary> /// <param name="m">ネイティブインタフェース</param> internal Mouse(asd.swig.Mouse m) { CoreInstance = m; leftButton = new SideButton(); rightButton = new SideButton(); middleButton = new MiddleButton(); }
public virtual void Ucitaj(System.IO.StreamReader sr) { this.domaca = sr.ReadLine(); this.gostujuca = sr.ReadLine(); this.ishod = (asd)int.Parse(sr.ReadLine()); this.iskDomacih = int.Parse(sr.ReadLine()); this.iskGosta = int.Parse(sr.ReadLine()); }
public override global::System.Data.DataSet Clone() { asd cln = ((asd)(base.Clone())); cln.InitVars(); cln.SchemaSerializationMode = this.SchemaSerializationMode; return(cln); }
public void TimeSpanTest() { asd t = new asd(); t.T1 = new TimeSpan(1, 2, 3); var tt = JsonSerializer.Serialize(t); var t2 = JsonSerializer.Deserialize <asd>(tt); }
/// <summary> /// コンストラクタ /// </summary> /// <param name="jc">ネイティブインタフェース</param> internal JoystickContainer(asd.swig.JoystickContainer jc) { CoreInstance = jc; joysticks = new Joystick[MAX_JOYSTICK_NUM]; for(int i=0;i<MAX_JOYSTICK_NUM;++i) { joysticks[i] = new Joystick(CoreInstance.GetJoystickAt(i)); } }
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) { asd ds = new asd(); global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); global::System.Xml.Schema.XmlSchemaAny any = new global::System.Xml.Schema.XmlSchemaAny(); any.Namespace = ds.Namespace; sequence.Items.Add(any); type.Particle = sequence; global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable(); if (xs.Contains(dsSchema.TargetNamespace)) { global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream(); global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream(); try { global::System.Xml.Schema.XmlSchema schema = null; dsSchema.Write(s1); for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();) { schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current)); s2.SetLength(0); schema.Write(s2); if ((s1.Length == s2.Length)) { s1.Position = 0; s2.Position = 0; for (; ((s1.Position != s1.Length) && (s1.ReadByte() == s2.ReadByte()));) { ; } if ((s1.Position == s1.Length)) { return(type); } } } } finally { if ((s1 != null)) { s1.Close(); } if ((s2 != null)) { s2.Close(); } } } xs.Add(dsSchema); return(type); }
public Circle(asd.Vector2DF position, asd.Vector2DF velocity, float diameter) { radius = diameter / 2; circleShape = new asd.CircleShape(); circleShape.OuterDiameter = diameter; Shape = circleShape; Position = position; Color = new asd.Color(255, 255, 255, 128); this.velocity = velocity; }
public static void Run() { BinanceMarketApi api = new BinanceMarketApi(null, null, ".\\Data2"); CombinedWebSocketClient cli = new CombinedWebSocketClient(); var symbols = api.GetSymbols().ToArray(); Stopwatch sw = new Stopwatch(); List <string> remaining = new List <string>(symbols.Select(s => s.Key)); var subscriber = new asd(); foreach (var sym in symbols) { //cli.SubscribePartialDepthStream(sym.Symbol, BinanceExchange.API.Enums.PartialDepthLevels.Five, // d => Console.WriteLine(sym.Symbol + "data")); //cli.SubscribeKlineStream(sym.Symbol, KlineInterval.OneMinute, d => //{ // if (d.Kline.IsBarFinal) // { // Console.WriteLine($"{DateTime.Now:mm.ss.fff} - {sym.Symbol}"); // if (remaining.Contains(d.Symbol)) // remaining.Remove(d.Symbol); // sw.Restart(); // } //}); cli.SubscribeKlineStream(sym.Key, KlineInterval.OneMinute, subscriber.Handle); } while (true) { Thread.Sleep(50); if (sw.ElapsedMilliseconds > 5000) { foreach (var sym in remaining) { Console.Write(sym + ","); } Console.WriteLine(); remaining = new List <string>(symbols.Select(s => s.Key)); sw.Reset(); cli.Unsubscribe <BinanceKlineData>(subscriber.Handle); } } }
static void Main(string[] args) { StreamReader sr = new StreamReader("map.in"); StreamWriter sw = new StreamWriter("map.out"); StringMap set = new asd(); string s = sr.ReadLine(); while (!string.IsNullOrEmpty(s)) { string[] parts = s.Split(' '); string key = parts[1]; if (parts[0] == "put") set.Put(key, parts[2]); if (parts[0] == "delete") set.Remove(key); if (parts[0] == "get") sw.WriteLine(set.Get(key) ?? "none"); s = sr.ReadLine(); } sw.Close(); }
//[Test] public override void Test(asd.GraphicsDeviceType graphicsType) { var option = new asd.EngineOption { GraphicsDevice = graphicsType, IsFullScreen = false }; var initialized = asd.Engine.Initialize("Empty", 640, 480, option); int time = 0; while (asd.Engine.DoEvents()) { asd.Engine.Update(); if (time == 10) break; time++; } asd.Engine.Terminate(); }
//[Test] public override void Test(asd.GraphicsDeviceType graphicsType) { var option = new asd.EngineOption { GraphicsDevice = graphicsType, IsFullScreen = false }; bool closed = false; System.Windows.Forms.Form form = new System.Windows.Forms.Form(); form.FormClosed += (object sender, System.Windows.Forms.FormClosedEventArgs e) => { closed = true; }; form.Show(); // aceを初期化する。 asd.Engine.InitializeByExternalWindow(form.Handle, new IntPtr(), form.Size.Width, form.Size.Height, new asd.EngineOption()); int time = 0; // aceが進行可能かチェックする。 while (asd.Engine.DoEvents()) { System.Windows.Forms.Application.DoEvents(); if (closed) break; // aceを更新する。 asd.Engine.Update(); if (time == 10) break; time++; } // aceを終了する。 asd.Engine.Terminate(); }
public PostEffect(asd.Graphics g) { if (g.GraphicsDeviceType == GraphicsDeviceType.DirectX11) { m_shader = g.CreateShader2D( shader2d_dx_ps ); } else if (g.GraphicsDeviceType == GraphicsDeviceType.OpenGL) { m_shader = g.CreateShader2D( shader2d_gl_ps ); } else { throw new Exception(); } m_material2d = g.CreateMaterial2D(m_shader); }
/// <summary> /// 頂点を追加する。 /// </summary> /// <param name="position">座標 </param> /// <param name="normal">法線 </param> /// <param name="binormal">従法線 </param> /// <param name="uv1">UV1 </param> /// <param name="uv2">UV2 </param> /// <param name="color">頂点色 </param> /// <param name="boneWeights">ボーンのウエイト </param> /// <param name="boneIndexes">ボーンのインデックス </param> public void AddVertex(asd.Vector3DF position, asd.Vector3DF normal, asd.Vector3DF binormal, asd.Vector2DF uv1, asd.Vector2DF uv2, asd.Color color, int boneWeights, int boneIndexes) { CoreInstance.AddVertex(ref position, ref normal, ref binormal, ref uv1, ref uv2, ref color, boneWeights, boneIndexes); }
static void Main() { Application.ApplicationExit += Application_ApplicationExit; Debug.Listeners.Add(new TextWriterTraceListener(Console.Out)); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); var asd = new asd() { fffffffffffffffffffff = "sasssssssssssssssss" }; asd.Add(new dasd() { asd = "sans1" }); asd.Add(new dasd() { asd = "sans2" }); asd.Add(new dasd() { asd = "sans3" }); asd.Add(new dasd() { asd = "sans4" }); asd.Add(new dasd() { asd = "sans5" }); asd.Add(new dasd() { asd = "sans6" }); var rr = new asedf() { asd = asd }; Console.WriteLine(NUMC.Json.JsonSerializer.Convert(rr)); Console.Read(); Console.WriteLine(NUMC.Json.JsonSerializer.Convert(NUMC.Json.JsonSerializer.Convert <asedf>(NUMC.Json.JsonSerializer.Convert(rr)))); //var r = NUMC.Setting.Json.Convert(new Test1()); //Console.WriteLine(r); //var f = NUMC.Setting.Json.Convert<Test1>(r); //Console.WriteLine(NUMC.Setting.Json.Convert(f)); //var l = Enum.GetValues(typeof(Keys)); //var min = 1; //var max = 0; //for (int i = 0; i < l.Length; i++) //{ // var v = (int)((Keys)l.GetValue(i)); // if (min > v) min = v; // if (max < v) max = v; //} //Console.WriteLine(min); //Console.WriteLine(max); //Console.WriteLine(Encoding.UTF8.GetString(NUMC.Setting.CmprsSerializer.Deserialize(Convert.FromBase64String(NUMC.Plugins.KeyboardLayouts.KeyboardLayoutResource.KeyBoard)))); //Console.WriteLine(Convert.ToBase64String(NUMC.Setting.CmprsSerializer.Serialize(Encoding.UTF8.GetBytes(File.ReadAllText(@"D:\Users\soju_\Downloads\asdasdasdasdasd.txt"))))); //var d = new NUMC.Plugins.KeyboardLayouts.Asdasdas(); //var e = NUMC.Setting.CmprsSerializer.SerializeJsonObject(d.GAK()); //Console.WriteLine(Convert.ToBase64String(e)); //Console.WriteLine(e.Length); //var es = NUMC.Setting.CmprsSerializer.Serialize(Encoding.UTF8.GetBytes(Resource1.sad)); //Console.WriteLine(Convert.ToBase64String(es)); Console.Read(); #region asd //new Form4().ShowDialog(); //var t = Task.Run(async () => //{ // var r = await NUMC.Client.Update.GetLatestReleaseAsync(); // await NUMC.Client.Update.DownloadDialogShow(r.Object); //}); //t.Wait(); //Console.Read(); //var t = NUMC.Client.NUMC.PluginStore.GetProxyStoreAsync(); //t.Wait(); //var r = t.Result.ResponseObject; //Debug.WriteLine(r.Archive_URL); //foreach (var item in r.Plugins) //{ // Debug.WriteLine(item.Title); // Debug.WriteLine(item.Overview); // Debug.WriteLine(item.Image_URL); // Debug.WriteLine(item.Publisher); // Debug.WriteLine(item.Name); // Debug.WriteLine(item.Size); // Debug.WriteLine(item.Hash); //} //Console.Read(); //var d = new Hash(Assembly.GetExecutingAssembly()); //Debug.WriteLine(Convert.ToBase64String(d.MD5)); //Console.ReadLine(); //JsonObject.RootObject obj = new JsonObject.RootObject(); //for (int i = 0; i < 5; i++) //{ // var k = new JsonObject.Keys(); // for (int l = 0; l < 3; l++) // { // var r = new JsonObject.Key(); // add(r, 1, $"root keys key #{l}"); // k.Add($"root keys key #{l}", r); // } // obj.Add($"root keys #{i}", k); //} //Console.WriteLine(NUMC.Setting.Json.Convert(obj)); //Console.ReadLine(); //void add(JsonObject.Key key, int r, string d) //{ // r -= 1; // for (int h = 0; h < 5; h++) // { // var v = new JsonObject.Value(); // v.SetString(d + $" value #{h}"); // key.Values.Add(d + $" value #{h}", v); // } // if(r >= 0) // for (int i = 0; i < 1; i++) // { // var k = new JsonObject.Key(); // add(k, r, d + $" subkeys key{i}"); // key.SubKeys.Add(d + $" subkeys key{i}", k); // } //} // {/looooooooooooooooooooooooooooong string} //var s = "{/looooooooooooooooooooooooooooong string}"; //Console.WriteLine(s.Length); //Console.ReadLine(); //{ // long size = 0; // object o = new object(); // using (Stream asdf = new MemoryStream()) // { // BinaryFormatter formatter = new BinaryFormatter(); // formatter.Serialize(asdf, o); // size = asdf.Length; // } // Console.WriteLine(size); //} //Console.ReadLine(); //var sd = (CmprsString)s; //Console.WriteLine(Marshal.SizeOf(sd)); //Console.ReadLine(); //var ls = new List<NUMC.Script.JsonObject.Keys>(); //Console.ReadLine(); //for (int i = 0; i < 500000; i++) //{ // var d = new NUMC.Script.JsonObject.Keys(); // { // var dgf = new Key(); // dgf.Values.Add("value1", new Value() { Data = "wa sans!" }); // dgf.Values.Add("value2", new Value() { Data = "wa sans! 2" }); // { // var sad = new Key(); // sad.Values.Add("sub key value 1", new Value() { Data = "asdasdfasdfsdfg" }); // dgf.SubKeys.Add("subKey", sad); // } // d.Add("key1 #1", dgf); // } // var sadasd = new Key(); // sadasd.Values.Add("dfssdfdfs", new Value() { Data = "ppppppppppp" }); // d.Add("key1", sadasd); // var asd = NUMC.Setting.Json.Convert(d); // //Console.WriteLine(asd); // var w = NUMC.Setting.Json.Convert<NUMC.Script.JsonObject.Keys>(asd); // //Console.WriteLine(NUMC.Setting.Json.Convertt(w)); // ls.Add(w); //} //Console.ReadLine(); //ls.Clear(); //GC.Collect(); //Console.ReadLine(); //var f = new Value(1); //var d = NUMC.Setting.Json.Convert(f); //Console.WriteLine(d); //while (true) //{ // var d = Console.ReadLine(); // var f = NUMC.Setting.Json.BeautifierJson(d.Replace("\\n", "\n")); // Console.WriteLine("========================"); // Console.WriteLine(f); //} //Console.WriteLine(NUMC.Setting.Json.Convert(new double[] { 1.1234324D, 2312312D, 123213D, 3D, 432.49244234D })); //Console.ReadLine(); //var f = new NUMC.Script.Ini("[wa]\nsans=!"); //foreach (var item in f) //{ // Console.WriteLine(item.Value["sans"].Value); //} //Console.Read(); #endregion #region asfd NUMC.Keyboard.KeyboardHook.HookStart(); //var sad = new WebClient(); //sad.DownloadFile("https://github.com/Soju06/NUMC/releases/download/v1.1.0-beta.0/NUMC.zip", "za.zip"); //Console.Read(); //while (true) //{ // Console.Write("1: "); // string e = Console.ReadLine(); // Console.Write("2: "); // string f = Console.ReadLine(); // if (!NUMC.Client.Version.TryParse(e, out NUMC.Client.Version version) || !NUMC.Client.Version.TryParse(f, out NUMC.Client.Version version1)) // Console.WriteLine("failed"); // else // { // Console.WriteLine($"{version.ToString()} > {version1.ToString()}"); // Console.WriteLine(version > version1); // } //} //var ad = NUMC.Client.Update.GetLatestRelease(); //ad.Wait(); //var sd = ad.Result; //Console.WriteLine(); //var r = NUMC.Client.GitHub.Releases.GetReleases(NUMC.Client.GitHub.GitHub.NUMCRepositoriesName); //r.Wait(); //var rm = r.Result.ResponseObject; ////var r = NUMC.Client.Update.GetRelease(); ////r.Wait(); ////Console.WriteLine(NUMC.Client.Update.Compare(r.Result)); ////NUMC.Forms.Dialogs.ReleaseDownloader.ShowDownloader(rm[1], new NUMCUpdateHandler(rm[1])); //var d = NUMC.Client.Update.DownloadDialogShow(rm[1]); //d.Wait(); //foreach (var item in rm) //{ // //Console.WriteLine("Name: {0}", item.Name); // Console.WriteLine("TagName: {0}", item.Tag_name); // //Console.WriteLine("Published_at: {0}", item.Published_at); // //Console.WriteLine("Login: {0}", item.Author.Login); // //Console.WriteLine("Body: {0}", item.Body); //} //Console.Read(); //Thread.Sleep(1000); // Stopwatch stopwatch = new Stopwatch(); //stopwatch.Start(); // for (int i = 0; i < 100000; i++) // { // var a = new ScriptInfo(Keys.Control, new Asdsa() { a = 123 }); // Console.WriteLine(a.Keys); // Console.WriteLine(a.Object.a); // a.Keys = Keys.Shift; // a.Object.a = 456; // Console.WriteLine(a.Keys); // Console.WriteLine(a.Object.a); // } //stopwatch.Stop(); //Stopwatch stopwatch1 = new Stopwatch(); //stopwatch1.Start(); //for (int i = 0; i < 100000; i++) //{ // var a = new ScriptInfo1(Keys.Control, new Asdsa() { a = 123 }); // Console.WriteLine(a.Keys); // Console.WriteLine(a.Object.a); // a.Keys = Keys.Shift; // a.Object.a = 456; // Console.WriteLine(a.Keys); // Console.WriteLine(a.Object.a); //} //stopwatch1.Stop(); //Console.WriteLine("{1} {0}", stopwatch.ElapsedTicks, stopwatch.ElapsedMilliseconds); //Console.WriteLine("{1} {0}", stopwatch1.ElapsedTicks, stopwatch1.ElapsedMilliseconds); //Console.Read(); #endregion Application.Run(new Form3()); Console.Read(); }
public MovingObject(asd instance) { _internal = instance; }
public abstract void Test(asd.GraphicsDeviceType graphicsType);
/// <summary> /// 光線を飛ばし、衝突した位置を取得する。 /// </summary> /// <param name="from">光線を飛ばす元の位置 </param> /// <param name="to">光線を飛ばす先の位置 </param> /// <returns>光線が地形に衝突した位置。衝突しない場合、NaNを返す。 </returns> public asd.Vector3DF CastRay(asd.Vector3DF from, asd.Vector3DF to) { return CoreInstance.CastRay(ref from, ref to); }
public override void OnDraw(asd.RenderTexture2D dst, asd.RenderTexture2D src) { // マテリアルを経由してシェーダー内のg_texture変数に画面の画像(src)を入力する。 material2d.SetTexture2D("g_texture", src); // 出力画像(dst)に指定したマテリアルで描画する。 DrawOnTexture2DWithMaterial(dst, material2d); }
/// <summary> /// コンストラクタ /// </summary> /// <param name="js">ネイティブインタフェース</param> internal Joystick(asd.swig.Joystick js) { CoreInstance = js; }
public override void OnDraw(asd.RenderTexture2D dst, asd.RenderTexture2D src) { m_material2d.SetTexture2D("g_texture", src); m_material2d.SetVector3DF("g_values", new Vector3DF(640, 480, 200)); DrawOnTexture2DWithMaterial(dst, m_material2d); }
/// <summary> /// ボーンとの接続設定を追加する。 /// </summary> /// <param name="targetIndex">対象ボーンインデックス </param> /// <param name="boneToMesh">ボーンの行列をメッシュの行列に変換する行列 </param> public void AddBoneConnector(int targetIndex, asd.Matrix44 boneToMesh) { CoreInstance.AddBoneConnector(targetIndex, ref boneToMesh); }
public override void OnDraw(asd.RenderTexture2D dst, asd.RenderTexture2D src) { // マテリアルを経由してシェーダー内のg_texture変数に画面の画像(src)を入力する。 material2d.SetTexture2D("g_texture", src); // マテリアルを経由してシェーダー内のg_area変数にポストエフェクトを適用する範囲を入力する。 material2d.SetVector2DF("g_windowSize", new asd.Vector2DF(asd.Engine.WindowSize.X, asd.Engine.WindowSize.Y)); // マテリアルを経由してシェーダー内のg_area変数にポストエフェクトを適用する範囲を入力する。 material2d.SetVector4DF("g_area", new asd.Vector4DF(50,50, 200, 200)); // 出力画像(dst)に指定したマテリアルで描画する。 DrawOnTexture2DWithMaterial(dst, material2d); }
public VanishingComponent(asd.Object2D vanishedObject, int etime) { this.vanishedObject = vanishedObject; this.etime = etime; }
public void AddedForce(asd.Vector2DF acceleration) { velocity += acceleration; }
/** @brief @param name @param rotationOrder @param localMat @param globalMatInv */ /// <summary> /// ボーンを追加する。 /// </summary> /// <param name="name">ボーンの名称</param> /// <param name="parentBoneIndex">親ボーンのインデックス(親がない場合は-1)</param> /// <param name="rotationOrder">ボーンの回転行列の計算方法</param> /// <param name="localMat">ボーンのローカル変形行列</param> public void AddBone(string name, int parentBoneIndex, RotationOrder rotationOrder, asd.Matrix44 localMat) { SwigObject.AddBone(name, parentBoneIndex, (swig.RotationOrder)rotationOrder, ref localMat); }
/// <summary> /// コンストラクタ /// </summary> /// <param name="kb">C++へのインタフェースクラス</param> internal Keyboard(asd.swig.Keyboard kb) { CoreInstance = kb; }
public void Reflect(asd.Vector2DF direction) { direction.Normalize(); float dot = asd.Vector2DF.Dot(velocity, direction); velocity -= 1.8f * dot * direction; }
public void setVelocity(asd.Vector2DF velocity) { this.velocity = velocity; }
/// <summary> /// /// </summary> /// <param name="name"></param> /// <param name="value"></param> public void SetVector4DF(string name, asd.Vector4DF value) { CoreInstance.SetVector4DF(name, value); }