public void TestEnum4() { ObjectMapper om = Map.GetObjectMapper(typeof(Object4)); Object4 o = (Object4)om.CreateInstance(); om.SetValue(o, "Enum1", "55"); Assert.AreEqual(Enum2.Value2, o.Enum1); Assert.AreEqual("2", om.GetValue(o, "Enum1")); }
public RuneObject(int x, int y, int z, int type, object mainClass, int bX, int bY, int id, GameObject objects, GameObject animatedObjects) { localX = x / 128f; height = y / 128f; localY = z / 128f; if (mainClass is InteractiveObject) { if ((mainClass as InteractiveObject).renderable is Projectile) { isGfx = true; } } shouldMove = true; objectType = type; if (type == 1) { wallObj = (WallObject)mainClass; } if (type == 2) { obj2 = (WallDecoration)mainClass; } if (type == 3) { obj3 = (GroundDecoration)mainClass; } if (type == 4) { obj4 = (Object4)mainClass; } if (type == 5) { obj5 = (InteractiveObject)mainClass; } baseX = bX; baseY = bY; modelId = id; if (id > 0) { def = ObjectDef.forID(id); if (def != null) { if (def.animId != -1) { isAnimated = true; } } } myRuneMesh = new RuneMesh(); this.objectRoot = objects; this.animatedObjectsRoot = animatedObjects; }
public void OMM_SubConfig_Object_Conditional_SubConfigure_NoNewType() { Object4 obj = new Object4() { Value = 5000 }; string value1 = ObjectMessageMap.GetMessage(obj); string value2 = ObjectMessageMap.GetMessage(typeof(Object4)); Assert.AreEqual("Bullseye!", value1); Assert.AreEqual("", value2); }
public void DayOfWeekTest1() { ObjectMapper om = Map.GetObjectMapper(typeof(Object4)); Object4 o = (Object4)om.CreateInstance(); om.SetValue(o, "Dow1", "M"); om.SetValue(o, "Dow2", "F"); Assert.AreEqual(DayOfWeek.Monday, o.Dow1); Assert.AreEqual(DayOfWeek.Friday, o.Dow2); Assert.AreEqual("M", om.GetValue(o, "Dow1")); Assert.AreEqual("F", om.GetValue(o, "Dow2")); }
public void TestCustomString() { MappingSchema save = Map.DefaultSchema; Map.DefaultSchema = new TestMappingSchema(); ObjectMapper om = Map.GetObjectMapper(typeof(Object4)); Object4 o = new Object4(); om.SetValue(o, "Str", "Test"); Assert.AreEqual("Test", o.Str.Str); Map.DefaultSchema = save; }
private void IncBinding2_Button_Click(object sender, EventArgs e) { if (TopMount_radioButton.Checked == true) { if (Object4.Get_Height() + 0.5f < Object2.Get_Height()) { Object4.Set_Height(Object4.Get_Height() + 0.5f); } } else { if (Object4.Get_Height() - 0.5f > Object1.Get_Height()) { Object4.Set_Height(Object4.Get_Height() - 0.5f); } } }
private void DecLentil1_Button_Click(object sender, EventArgs e) { if (TopMount_radioButton.Checked == true) { if (Object1.Get_Height() - 0.5f >= 0) { Object1.Set_Height(Object1.Get_Height() - 0.5f); } } else { if (Object1.Get_Height() + 0.5f < Object4.Get_Height()) { Object1.Set_Height(Object1.Get_Height() + 0.5f); } } }
public void Test2() { ObjectMapper om = Map.GetObjectMapper(typeof(Object4)); Object4 o = (Object4)om.CreateInstance(); om.SetValue(o, "fld1", "Y"); om.SetValue(o, "Object3.Object2.Field2", 123); om.SetValue(o, "fld2", "str"); Assert.AreEqual(true, o.Object3.Object2.Field1); Assert.AreEqual(123, o.Object3.Object2.Field2); Assert.IsNull(o.Object3.Object4); Assert.AreEqual("Y", om.GetValue(o, "fld1")); Assert.AreEqual(123, om.GetValue(o, "Object3.Object2.Field2")); Assert.IsNull(om.GetValue(o, "fld2")); }
private void RenderTimer_Tick(object sender, EventArgs e) { DrawAllMatrix(); AngleValue_Label.Text = Convert.ToString(ChangeAngle_TrackBar.Value) + "°"; if (TopMount_radioButton.Checked == true) { label2.Text = Convert.ToString(Object1.Get_Height() / 10) + " м"; label3.Text = Convert.ToString(Object2.Get_Height() / 10) + " м"; label4.Text = Convert.ToString(Object3.Get_Height() / 10) + " м"; label5.Text = Convert.ToString(Object4.Get_Height() / 10) + " м"; } else { label2.Text = Convert.ToString(1 - Object1.Get_Height() / 10) + " м"; label3.Text = Convert.ToString(1 - Object2.Get_Height() / 10) + " м"; label4.Text = Convert.ToString(1 - Object3.Get_Height() / 10) + " м"; label5.Text = Convert.ToString(1 - Object4.Get_Height() / 10) + " м"; } }
private double f(double xt, double yt, double zt) { if (TopMount_radioButton.Checked == true) { float o1 = Object1.Get_Height() / 10; float o2 = Object2.Get_Height() / 10; float o3 = Object3.Get_Height() / 10; float o4 = Object4.Get_Height() / 10; L = o3 - (o1 + o2) / 2; I = 2 * 0.08 * 0.08 + M * Math.Pow((o1 - o3), 2) + M * Math.Pow((o2 - o3), 2); return(-G *M *L *Math.Sin(yt) / I); } else { float o1 = 1 - Object1.Get_Height() / 10; float o2 = 1 - Object2.Get_Height() / 10; float o3 = 1 - Object3.Get_Height() / 10; float o4 = 1 - Object4.Get_Height() / 10; L = o4 - (o1 + o2) / 2; I = 2 * 0.08 * 0.08 + Math.Pow((o1 - o4), 2) + Math.Pow((o2 - o4), 2); return(-G *L *Math.Sin(yt) / I); } }
public string Validate(Object4 prop4, string prop1, int prop3, string prop2) { if (prop1 != prop2 || prop3 == 0 || prop4 == null) { return "Condition Fail"; } return null; }
private void DrawAllMatrix() { if (Correct_Height != AnT.Size.Height || Correct_Width != AnT.Size.Width) { if (Correct_Height != AnT.Size.Height) { Correct_Height = AnT.Size.Height; } if (Correct_Width != AnT.Size.Width) { Correct_Width = AnT.Size.Width; } Gl.glViewport(0, 0, AnT.Width, AnT.Height); } Gl.glMatrixMode(Gl.GL_PROJECTION); Gl.glLoadIdentity(); Glu.gluPerspective(45, (float)AnT.Width / (float)AnT.Height, 0.1, 200); Gl.glMatrixMode(Gl.GL_MODELVIEW); Gl.glClearColor(0.7f * 1.2f, 0.999f * 1.2f, 0.568f * 1.2f, 1.0f);//фон редактить здесь Gl.glClear(Gl.GL_COLOR_BUFFER_BIT | Gl.GL_DEPTH_BUFFER_BIT); Gl.glEnable(Gl.GL_DEPTH_TEST); Gl.glEnable(Gl.GL_LIGHTING); Gl.glEnable(Gl.GL_LIGHT0); Gl.glEnable(Gl.GL_COLOR_MATERIAL); Gl.glColor3d(0.31, 0.31, 0.31); Gl.glRotated(-90, 1, 0, 0); Gl.glRotated(90, 0, 0, 1); Shtativ.DrawModel(); DrawGround();//КАТЯ, СТОЛ УБИРАЕТСЯ ЗДЕСЬ!!! Gl.glRotated(-90, 0, 0, 1); Gl.glRotated(90, 1, 0, 0); Gl.glColor3d(0.31, 0.31, 0.31); Gl.glPushMatrix(); Gl.glRotatef(-90, 1, 0, 0); Gl.glTranslatef(0, 0, 1); Gl.glRotated(Angle, 0, -1, 0); Gl.glTranslatef(0, 0, -1); if (TopMount_radioButton.Checked == true) { Gl.glTranslatef(0, 0, 1 - Object3.Get_Height() / 10); Glut.glutSolidCylinder(0.01d, 1, 200, 1); Gl.glColor3d(0, 0.0, 0.0); for (int i = 1; i < 20; i++) { Gl.glTranslatef(0, 0, 0.05f); Glut.glutSolidCylinder(0.0101d, 0.002, 200, 1); } Gl.glTranslatef(0, 0, -0.95f); Gl.glColor3d(0.75, 0, 0); Glut.glutSolidCylinder(0.0120d, 0.025, 200, 1); Gl.glColor3d(0.31, 0.31, 0.31); } if (BottomMount_radioButton.Checked == true) { Gl.glTranslatef(0, 0, 1 + Object4.Get_Height() / 10); Gl.glRotatef(-180, 1, 0, 0); Glut.glutSolidCylinder(0.01d, 1, 200, 1); Gl.glColor3d(0, 0.0, 0.0); for (int i = 1; i < 20; i++) { Gl.glTranslatef(0, 0, 0.05f); Glut.glutSolidCylinder(0.0101d, 0.002, 200, 1); } Gl.glColor3d(0.75, 0, 0); Gl.glTranslatef(0, 0, 0.025f); Glut.glutSolidCylinder(0.0120d, 0.025, 200, 1); Gl.glTranslatef(0, 0, -0.975f); Gl.glColor3d(0.31, 0.31, 0.31); } Gl.glColor3d(0.31, 0.31, 0.31); Gl.glDisable(Gl.GL_COLOR_MATERIAL); Gl.glPushMatrix(); Object1.Drawobject(); Object2.Drawobject(); Object3.Drawobject(false); Object4.Drawobject(true); Gl.glPopMatrix(); Gl.glPopMatrix(); Gl.glDisable(Gl.GL_DEPTH_TEST); Gl.glDisable(Gl.GL_LIGHTING); Gl.glDisable(Gl.GL_LIGHT0); Gl.glLoadIdentity(); Gl.glRotated(camXRot, 1, 0, 0); Gl.glRotated(camYRot, 0, 1, 0); Gl.glTranslated(camXPos, camYPos, camZPos); Gl.glTranslated(0, -0.5, -2.5); Gl.glFlush();//? AnT.Invalidate(); }