public void BuildModel(ModelManager Director) { GameObject CharacterModel = Director.GetModelByType(BuildData.GetModelType()); CharacterModel.AddComponent<ModelMotor> (); CharacterModel.AddComponent<EventGenerator> (); BuildedSoldier.SetModel (CharacterModel); }
public static ModelManager shareInstance() { if (null == _instance) { _instance = new ModelManager(); } return _instance; }
// TODO: targetEntityFrameworkRuntimeVersion is not correct and can be based on the target .NET Fx version or the namespace of the edmx file internal RuntimeMetadataValidator( ModelManager modelManager, Version targetEntityFrameworkRuntimeVersion, IDbDependencyResolver dependencyResolver) { Debug.Assert(modelManager != null, "modelManager != null"); Debug.Assert(targetEntityFrameworkRuntimeVersion != null, "targetEntityFrameworkRuntimeVersion != null"); _modelManager = modelManager; _targetEntityFrameworkRuntimeVersion = targetEntityFrameworkRuntimeVersion; _dependencyResolver = dependencyResolver; }
public void Initialize(ModelManager modelManager) { this.modelManager = modelManager; modelManager.SelectedAnimationChanged += new EventHandler<ReplacedEventArgs<Animation>>(modelManager_AnimationChanged); modelManager.SelectedFrameChanged += new EventHandler<ReplacedEventArgs<SaveFrame<Texture2DWithPos>>>(modelManager_FrameChanged); modelManager.FrameModified += new EventHandler<ContentsModifiedEventArgs<SaveFrame<Texture2DWithPos>>>(modelManager_FrameModified); }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { // TODO: Add your initialization logic here camera = new Camera(this, new Vector3(0, 50, -100), new Vector3(0, 0, 0), Vector3.Up); Components.Add(camera); modelManager = new ModelManager(this); Components.Add(modelManager); //Updated Code text = new Text(this); Components.Add(text); IsMouseVisible = true; base.Initialize(); }
public int CheckMaterial(ModelUI objUI, System.Data.SqlClient.SqlTransaction objTrans) { int Flag = 0; bool flagTransation = true; ModelDB objDB = new ModelDB(); objDB.Material = objUI.Material; DataAccessLayer objDataAccess = new DataAccessLayer(); try { if (objTrans == null) { flagTransation = false; objDataAccess.GetConnection.Open(); SqlTransaction objTransaction = objDataAccess.GetConnection.BeginTransaction(); objTrans = objTransaction; } ModelManager objManager = new ModelManager(); Flag = objManager.CheckMaterial(objDB, objTrans); if (!flagTransation) objTrans.Commit(); return Flag; } catch (Exception ex) { if (!flagTransation) objTrans.Rollback(); throw ex; } finally { objDataAccess.GetConnection.Close(); } }
public void EnterNewPriceNotesCA() { ModelManager test = new ModelManager(driver); test.EnterNewPriceNotesCA(); }
public override void Execute() { #line 2 "..\..\Areas\Admin\Views\ModelManagement\Index.cshtml" ViewBag.Title = G.GetModelTitle(C.Text(ViewBag.id)) + " Management"; Model.FirstRowAction = "Edit"; Model.FirstRowController = "ModelManagement"; Model.FirstRowArea = "Area"; Model.FirstRowObject = b => new { @area = G.AdminPath, @id = (b as ContentTableRowItem).Id, @type = ModelManager.GetMapperKey((b as ContentTableRowItem).ThisType.FullName) }; Model.DeleteFunctionName = "deleteRole"; var tableSize = TypeExtends.GetTableSize(Model.ThisTypeFrom); #line default #line hidden WriteLiteral("\r\n<form"); WriteLiteral(" id=\"modelDeleteForm\""); WriteAttribute("action", Tuple.Create(" action=\"", 536), Tuple.Create("\"", 604) #line 11 "..\..\Areas\Admin\Views\ModelManagement\Index.cshtml" , Tuple.Create(Tuple.Create("", 545), Tuple.Create <System.Object, System.Int32>(Url.Action("Delete", "ModelManagement", "@area=G.AdminPath") #line default #line hidden , 545), false) ); WriteLiteral(" method=\"post\""); WriteLiteral(">\r\n <input"); WriteLiteral(" type=\"hidden\""); WriteLiteral(" name=\"type\""); WriteAttribute("value", Tuple.Create(" value=\"", 656), Tuple.Create("\"", 675) #line 12 "..\..\Areas\Admin\Views\ModelManagement\Index.cshtml" , Tuple.Create(Tuple.Create("", 664), Tuple.Create <System.Object, System.Int32>(ViewBag.id #line default #line hidden , 664), false) ); WriteLiteral(" />\r\n <input"); WriteLiteral(" id=\"deleteId\""); WriteLiteral(" type=\"hidden\""); WriteLiteral(" name=\"deleteId\""); WriteLiteral(" value=\"\""); WriteLiteral(" />\r\n</form>\r\n<div"); WriteLiteral(" class=\"row clearfix\""); WriteLiteral(">\r\n <div"); WriteLiteral(" class=\"col-lg-12 col-md-12 col-sm-12 col-xs-12\""); WriteLiteral(">\r\n <div"); WriteLiteral(" class=\"card\""); WriteLiteral(">\r\n <div"); WriteLiteral(" class=\"card-header\""); WriteLiteral(">\r\n <div"); WriteLiteral(" class=\"button-box\""); WriteLiteral(">\r\n\r\n <a"); WriteAttribute("href", Tuple.Create(" href=\"", 946), Tuple.Create("\"", 1033) #line 21 "..\..\Areas\Admin\Views\ModelManagement\Index.cshtml" , Tuple.Create(Tuple.Create("", 953), Tuple.Create <System.Object, System.Int32>(Url.Action("Create", "ModelManagement", new { @area = G.AdminPath, @id = ViewBag.id }) #line default #line hidden , 953), false) ); WriteLiteral(" class=\"btn btn-info btn-group\""); WriteLiteral(">Create</a>\r\n </div>\r\n\r\n </div>\r\n\r\n <div"); WriteLiteral(" class=\"body\""); WriteLiteral(">\r\n"); #line 27 "..\..\Areas\Admin\Views\ModelManagement\Index.cshtml" #line default #line hidden #line 27 "..\..\Areas\Admin\Views\ModelManagement\Index.cshtml" Html.RenderPartial("Contents/_ContentTableHtml", Model); #line default #line hidden WriteLiteral("\r\n\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n"); DefineSection("script", () => { WriteLiteral("\r\n <script>\r\n $(function () {\r\n $(\'.basic-example\').DataTable(\r\n " + "{\r\n \"pageLength\": "); #line 39 "..\..\Areas\Admin\Views\ModelManagement\Index.cshtml" Write(tableSize); #line default #line hidden WriteLiteral("\r\n } \r\n );\r\n });\r\n </script>\r\n "); WriteLiteral(@" <script> $(function () { $('.sweetalert_delete.delete_button').on('click', function () { var id = $(this).data('id'); showCancelMessage(function(){ $('#deleteId').val(id); if(id){ document.getElementById('modelDeleteForm').submit() } }) }); }); function deleteRole(id){ showCancelMessage(function(){ $('#deleteId').val(id); if(id){ document.getElementById('modelDeleteForm').submit() } }) } function showCancelMessage(callback) { swal({ title: ""Are you sure?"", text: ""You will not be able to recover!"", type: ""warning"", showCancelButton: true, confirmButtonColor: ""#DD6B55"", confirmButtonText: ""Yes, delete it!"", cancelButtonText: ""No, cancel plx!"", closeOnConfirm: false, closeOnCancel: false }, function (isConfirm) { if (isConfirm) { swal(""Deleted!"", ""Your record has been deleted."", ""success""); if(callback){ callback(); } } else { swal(""Cancelled"", ""Your record is safe :)"", ""error""); } }); } </script> "); }); WriteLiteral("\r\n"); }
private static string ChargeTipsMessage(int generalId, int modelId) { ModelInfo cacheModelById = ModelManager.GetCacheModelById(modelId); return(cacheModelById.ChargeTips.Replace("{$FileName}", SiteConfig.SiteInfo.VirtualPath + "Item").Replace("{$Id}", generalId.ToString()).Replace("{$ModelName}", cacheModelById.ModelName)); }
static void Main() { // Initializing required database engine modules: // - Basic operations // - N3-Interpreter // - Brain Initializer.Initialize(); Logics.N3.Initializer.Initialize(); Logics.Think.Initializer.Initialize(); // Read/Write operations example using (var model = ModelManager.CreateInMemoryModel(Names.Frans)) { var agePredicate = model.CreateName("age"); // Writing... // using AddFact (recommended way) model.AddFact(Names.Caroline, Names.Mother, Names.Maria); // Directly, by adding a statement... model.AddStatement(Names.Maria, Names.Child, Names.Caroline); // or statements model.AddStatements( new[] { new Statement(Names.Maria, Names.Child, Names.Geert) }); // Implying that the subject is model.Name model.AddFact(Names.Child, Names.Caroline); model.AddFact(agePredicate, 42); // Straightforward way to read... // Full statements var statements = model.GetStatements(Names.Caroline, Names.Mother); Console.WriteLine("Caroline's mother (GetStatements): {0}", Helpers.Beautify(statements.First().Object)); // Or statement objects only var facts = model.GetFacts(Names.Caroline, Names.Mother); Console.WriteLine("Caroline's mother (GetFacts): {0}", Helpers.Beautify(facts.First())); // Getting single object var fact = model.GetFact(Names.Frans, Names.Child); Console.WriteLine("Frans's child (GetFact): {0}", Helpers.Beautify(fact)); // Or single value var fransAge = model.GetFact <int>(Names.Frans, agePredicate); Console.WriteLine("Frans's age (GetFact<int>): {0}", fransAge); // Checking fact existence var mariaChildGreet = model.HasFact(Names.Maria, Names.Child, Names.Geert); Console.WriteLine("Maria has a child named Greet (HasFact): {0}", mariaChildGreet); // Getting subjects var carolineParent = model.GetSubjects(Names.Child, Names.Caroline); Console.WriteLine("Caroline's parents are (GetSubjects): ({0})", string.Join(" ", carolineParent.Select(Helpers.Beautify))); // Optimized way... // There are the same set of methods to make queries omitting inference engine (the Brain). // If database models are nested into each over and there are several brains in work, only the top-level brain is ignored. // If there are not brains in work, axioms database is considered as empty. var carolineMother = model.GetAxiom(Names.Frans, Names.Mother); Console.WriteLine("Caroline's mother (GetAxiom): {0}", Helpers.Beautify(carolineMother)); } }
private void startBake_Click(object sender, EventArgs e) { // 入力チェック if (!File.Exists(pmdFileName.Text)) { MessageBox.Show( "PMDファイルが見つかりません!:\n" + pmdFileName.Text, "PMD読み込みエラー", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (!File.Exists(vmdFileName.Text)) { MessageBox.Show( "VMDファイルが見つかりません!:\n" + vmdFileName.Text, "VMD読み込みエラー", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } // saveVMDの上書き確認 if (File.Exists(saveVmdName.Text)) { var result = MessageBox.Show( "VMDファイルが存在します。\n" + saveVmdName.Text + "\n上書きしてよろしいですか?", "上書き確認", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); if (result != System.Windows.Forms.DialogResult.Yes) { return; } // bakeでエラー出るっぽいので削除しておく File.Delete(saveVmdName.Text); } // Bake! try { MMDModel1 model = (MMDModel1)ModelManager.Read(pmdFileName.Text, MikuMikuDance.Model.CoordinateType.RightHandedCoordinate); MMDMotion2 motion = (MMDMotion2)MotionManager.Read(vmdFileName.Text, MikuMikuDance.Motion.CoordinateType.RightHandedCoordinate); motion = IKBaker.bake(motion, model); MotionManager.Write(saveVmdName.Text, motion); MessageBox.Show( "Bake完了", "Baked!!"); } catch { MessageBox.Show( "Bake中にエラーが発生しました", "未知のエラー", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } }
private void OpenModelInExternalTool(object sender, RoutedEventArgs e) { ModelManager.OpenModelInExternalTool(this); }
private void AddInputMenu(object sender, RoutedEventArgs e) { ModelManager.AddInputConnector(this); }
public ModelBase() { name = this.GetType().Name; ModelManager.Regist(this); Init(); }
override public void MouseMove(ModelManager model_manager, CCamera camera, Control control, MouseEventArgs e) { if (is_mid_mouse_on) { //ミドルボタンが押されているときはカメラの回転処理 //この時、モデルが選ばれていたらモデルの中心点を中心に回転 int sub_x = mouse_old_x - e.X; int sub_y = mouse_old_y - e.Y; double angle_x = Math.PI * sub_x / 180.0; double angle_y = Math.PI * sub_y / 180.0; if (Math.Abs(sub_x) < 1 && Math.Abs(sub_y) < 1) { return; } Vector3d center; if (model_manager.getModelList().Count > 0) { center = model_manager.getModelList()[0].getCenterPoint(); } else { center = new Vector3d(0, 0, 0); } camera.eyeRotateAxis(center, angle_x, camera.getUp()); Vector3d axis = camera.getUp().cross(camera.getEye() - camera.getCenter()); axis.Normalize(); camera.eyeRotateAxis(center, angle_y, axis); mouse_old_x = e.X; mouse_old_y = e.Y; Gl.glMatrixMode(Gl.GL_PROJECTION); Gl.glLoadIdentity(); camera.ApplyProjection(); camera.gluLookAtLH(); Gl.glMatrixMode(Gl.GL_MODELVIEW); control.Invalidate(); } else { foreach (CLoadedObject obj in model_manager.getModelList()) { obj.state.onMouseLeave(obj, e); } Gl.glMatrixMode(Gl.GL_PROJECTION); Gl.glPushMatrix(); Gl.glMatrixMode(Gl.GL_MODELVIEW); Gl.glPushMatrix(); int[] viewport = new int[4]; Gl.glViewport(0, 0, control.Width, control.Height); Gl.glGetIntegerv(Gl.GL_VIEWPORT, viewport); TransformMatrixes trans = new TransformMatrixes(); List <SelectionData> picks; try { picks = Selection.Pick <CLoadedObject>(model_manager.getSelectionDict(), new double[] { e.X, control.Height - e.Y - 1 }, new double[] { 1, 1 }, camera, viewport, false, out trans); } catch (Exception except) { return; } SelectionData selected = Selection.GetNearest(picks); if (selected != null) { (selected.item as CLoadedObject).state.onMouseOver(selected.item, e); // (selected.item as CLoadedObject).changeState(new Jusin.ObjectModel.State.ModelStateSelected()); } Gl.glMatrixMode(Gl.GL_PROJECTION); Gl.glPopMatrix(); Gl.glMatrixMode(Gl.GL_MODELVIEW); Gl.glPopMatrix(); } }
void loadConfig(bool forDeploy = false) { log("Loading client configuration"); clientConfigManager = new ClientConfigManager(); rootPath = workingDirectory; binPath = rootPath + "bin\\" + branch + "\\"; if (!System.IO.Directory.Exists(rootPath + "bin\\")) { System.IO.Directory.CreateDirectory(rootPath + "bin\\"); } if (!System.IO.Directory.Exists(rootPath + "bin\\" + branch + "\\")) { System.IO.Directory.CreateDirectory(rootPath + "bin\\" + branch + "\\"); } string buildconf = "build"; if (rootPath.Contains("buildagent2")) { buildconf = "build2"; } clientConfigManager.load(rootPath + "config\\" + (forDeploy ? branch : buildconf) + "_" + "usp" + ".axc"); // rootPath + "config\\" + clientConfig); log("Client configuration loaded"); log("Loading server configuration"); serverConfigManager = new ServerConfigManager(); serverConfigManager.load(clientConfigManager.ServerName, clientConfigManager.PortNumber); log("Server configuration loaded"); mgr = new AOSManager() { ServerName = clientConfigManager.ServerName, // "april-ax-build", ServiceId = serverConfigManager.ServerServiceIdentifier, // "AOS60$01", TimeOutMinutes = 10 }; if (forDeploy) { mgr.TimeOutMinutes = 30; } client = new ClientManager(); client.AXClientBinPath = clientConfigManager.ClientBinPath; client.AXServerBinPath = serverConfigManager.ServerBinPath; client.AXConfigurationFile = rootPath + "config\\" + (forDeploy ? branch : buildconf) + "_" + "usp" + ".axc"; // rootPath + "config\\" + clientConfig; client.ModelManifest = rootPath + branch + "\\" + modelName + "\\Model.xml"; client.TimeOutMinutes = 60; model = new ModelManager() { AOSName = serverConfigManager.AOSName, SchemaName = "temp" }; sqlManager = new SQLManager(); sqlManager.DatabaseName = serverConfigManager.DatabaseName; sqlManager.Server = serverConfigManager.DatabaseServer; labelManager = new LabelManager(); }
private void ProcessQueries_MultipleDeals(string[] TrancheIDScope, int status) { string TrancheID = ""; MasterTable = new DataTable(); ModelManager mm = new ModelManager(); YieldSurModMgr ym = new YieldSurModMgr(AsOfDate.ToString("yyyyMMdd")); Task PreRTasks = Task.Run(() => { if (TrancheIDScope.Length > 0) { TrancheID = TrancheIDScope[0]; DataRow idr = ProcessQueries_SingleDeal(TrancheID.Split('.')[0], TrancheID.Split('.')[1], status); foreach (DataColumn idc in idr.Table.Columns) { MasterTable.Columns.Add(idc.ColumnName, idc.DataType); } MasterTable.Rows.Add(idr.ItemArray); if (TrancheIDScope.Length > 1) { Parallel.For(1, TrancheIDScope.Length, (i) => { TrancheID = TrancheIDScope[i]; DataRow jdr = ProcessQueries_SingleDeal(TrancheID.Split('.')[0], TrancheID.Split('.')[1], status); MasterTable.Rows.Add(jdr.ItemArray); }); } } LastBondToCalculateLife = true; }); Task RTasks = Task.Run(() => { while (!LastBondToCalculateLife || CallDateQueue.Count > 0) { BondStructure bs; double expMaturiy; if (CallDateQueue.TryDequeue(out bs)) { try { mm.PriceBond(bs, false); expMaturiy = Math.Max(0.1, ((bs.EarliestCall.AddDays(mm.GetExpectedLife()) - bs.AsOfDate).Days / 365.25)); } catch (Exception) { expMaturiy = double.NaN; } exLifeDictionary.Add(bs.TrancheID, expMaturiy); } } while (DMQueue.Count > 0) { DataRow iRow; double requiredDM = double.NaN; if (DMQueue.TryDequeue(out iRow)) { try { requiredDM = ym.GetDM(iRow["MODIFIED_RATING"].ToString(), To_DM_Model_Dataframe(iRow)); } catch (Exception) { requiredDM = double.NaN; } DM_Dictionary.Add(iRow["Deal Name"].ToString(), requiredDM); PricesQueue.Enqueue(new Tuple <string, DateTime, double>(iRow["Deal Name"].ToString(), AsOfDate, requiredDM)); } } FinishRCalculations = true; }); Task PostRTask = Task.Run(() => { List <Task> Tasks = new List <Task>(); while (!FinishRCalculations || PricesQueue.Count > 0) { Tuple <string, DateTime, double> PriceCombo; Tuple <double, double, double, double> CDR_Prices; Tuple <double, double> JustCDRs; if (PricesQueue.TryDequeue(out PriceCombo)) { Tasks.Add(Task.Factory.StartNew(() => { if (!double.IsNaN(PriceCombo.Item3)) { CDR_Prices = Coordinator.Do_CDR_Prices(PriceCombo.Item1, PriceCombo.Item2, PriceCombo.Item3); } else { JustCDRs = Coordinator.BreakPIKCDR(PriceCombo.Item1, PriceCombo.Item2); CDR_Prices = new Tuple <double, double, double, double>(JustCDRs.Item1, JustCDRs.Item2, double.NaN, double.NaN); } PIKCDR_Dictionary.Add(PriceCombo.Item1, CDR_Prices.Item1); BrkEvenCDR_Dictionary.Add(PriceCombo.Item1, CDR_Prices.Item2); CleanPriceDictionary.Add(PriceCombo.Item1, CDR_Prices.Item3); DirtyPriceDictionary.Add(PriceCombo.Item1, CDR_Prices.Item4); })); } } Task.WaitAll(Tasks.ToArray()); }); Task.WaitAll(PreRTasks, RTasks, PostRTask); //###### Post R operation ####### string CallDate_ColumnName = "exLife"; DataColumn CallDate_Column = new DataColumn(CallDate_ColumnName, typeof(double)); MasterTable.Columns.Add(CallDate_Column); string Yield_ColumnName = "ReqDM"; DataColumn Yield_Column = new DataColumn(Yield_ColumnName, typeof(double)); MasterTable.Columns.Add(Yield_Column); string CleanPrice_ColumnName = "CleanPx"; DataColumn CleanPx_Column = new DataColumn(CleanPrice_ColumnName, typeof(double)); MasterTable.Columns.Add(CleanPx_Column); string DirtyPrice_ColumnName = "DirtyPx"; DataColumn DirtyPx_Column = new DataColumn(DirtyPrice_ColumnName, typeof(double)); MasterTable.Columns.Add(DirtyPx_Column); foreach (DataRow idr in MasterTable.Rows) { try { idr[CallDate_ColumnName] = exLifeDictionary[idr["Deal Name"].ToString()]; } catch (Exception) { idr[CallDate_ColumnName] = double.NaN; } try { idr[Yield_ColumnName] = DM_Dictionary[idr["Deal Name"].ToString()]; } catch (Exception) { idr[Yield_ColumnName] = double.NaN; } try { idr[CleanPrice_ColumnName] = CleanPriceDictionary[idr["Deal Name"].ToString()]; } catch (Exception) { idr[CleanPrice_ColumnName] = double.NaN; } try { idr[DirtyPrice_ColumnName] = DirtyPriceDictionary[idr["Deal Name"].ToString()]; } catch (Exception) { idr[DirtyPrice_ColumnName] = double.NaN; } } }
public override void TakeMsg(ActorModel who, EventMsg msg) { switch (msg.Type) { case EventType.GetBumped: ActorModel bumper = msg.Source; if (bumper.Type == ThingTypes.Player) { if (God.GSM.scoreIsVisible) { TileModel loc = who.GetLocation(); who.View.GetComponentInChildren <SpriteRenderer>().color = new Color32(255, 255, 255, 255); who.View.transform.GetComponentInParent <TileView>().GetComponentInChildren <SpriteRenderer>().color = new Color32(255, 255, 255, 255); God.C.AddAction(new GetScoreAction(bumper, who)); who.Despawn(); ModelManager.ChangeScore(1); bumper.SetLocation(loc); } } return; case EventType.GetName: msg.Text += " SCORETHING"; return; case EventType.ScoreMove: if (God.GSM.scoreMovement < God.GSM.monsterRound) { God.GSM.scoreMovement++; } else if (God.GSM.scoreMovement == God.GSM.monsterRound) { int rand = Random.Range(0, 2); Debug.Log(rand); if (rand == 1) { if (who.Location.x > GameSettings.playerX) { who.Move(-1, 0); } else if (who.Location.x < GameSettings.playerX) { who.Move(1, 0); } } else if (rand == 0) { if (who.Location.y > GameSettings.playerY) { who.Move(0, -1); } else if (who.Location.y < GameSettings.playerY) { who.Move(0, 1); } } //God.GSM.AS.PlayOneShot(God.GSM.StompClip); God.GSM.scoreMovement = 0; } return; } }
public MPQTriangleSupplier() { string[] archiveNames = { "patch.MPQ", "enUS\\patch-enUS.MPQ", "enGB\\patch-enGB.MPQ", "lichking.MPQ", "common-2.MPQ", "common.MPQ", "expansion.MPQ", "enUS\\lichking-locale-enUS.MPQ", "enUS\\locale-enUS.MPQ", "enUS\\expansion-locale-enUS.MPQ", "enGB\\lichking-locale-enGB.MPQ", "enGB\\locale-enGB.MPQ", "enGB\\expansion-locale-enGB.MPQ", "enUS\\base-enUS.MPQ", "enGB\\base-enGB.MPQ", "enUS\\backup-enUS.MPQ", "enGB\\backup-enGB.MPQ"}; //StormDll.ArchiveSet archive = null; archive = new StormDll.ArchiveSet(); string regGameDir = archive.SetGameDirFromReg(); //string gameDir = "F:\\World of Warcraft\\Data\\"; //archive.SetGameDir(gameDir); Console.WriteLine("Game dir is " + regGameDir); archive.AddArchives(archiveNames); modelmanager = new ModelManager(archive, 80); wmomanager = new WMOManager(archive, modelmanager, 30); archive.ExtractFile("DBFilesClient\\AreaTable.dbc", "PPather\\AreaTable.dbc"); DBC areas = new DBC(); DBCFile af = new DBCFile("PPather\\AreaTable.dbc", areas); for (int i = 0; i < areas.recordCount; i++) { int AreaID = (int)areas.GetUint(i, 0); int WorldID = (int)areas.GetUint(i, 1); int Parent = (int)areas.GetUint(i, 2); string Name = areas.GetString(i, 11); areaIdToName.Add(AreaID, Name); if (WorldID != 0 && WorldID != 1 && WorldID != 530) { //// Console.WriteLine(String.Format("{0,4} {1,3} {2,3} {3}", AreaID, WorldID, Parent, Name)); } //0 uint AreaID //1 uint Continent (refers to a WorldID) //2 uint Region (refers to an AreaID) } for (int i = 0; i < areas.recordCount; i++) { int AreaID = (int)areas.GetUint(i, 0); int WorldID = (int)areas.GetUint(i, 1); int Parent = (int)areas.GetUint(i, 2); string Name = areas.GetString(i, 11); string TotalName = ""; //areaIdToName.Add(AreaID, Name); //areaIdParent.Add(AreaID, Parent); string ParentName = ""; if (!areaIdToName.TryGetValue(Parent, out ParentName)) { TotalName = ":" + Name; } else TotalName = Name + ":" + ParentName; try { zoneToMapId.Add(TotalName, WorldID); //Console.WriteLine(TotalName + " => " + WorldID); } catch { int id; zoneToMapId.TryGetValue(TotalName, out id); //// Console.WriteLine("Duplicate: " + TotalName + " " + WorldID +" " + id); } //0 uint AreaID //1 uint Continent (refers to a WorldID) //2 uint Region (refers to an AreaID) } }
private void RemoveModelFromDiagram(object sender, RoutedEventArgs e) { ModelManager.RemoveModel(this); }
private void OpenParameterMenu(object sender, RoutedEventArgs e) { ModelManager.DisplayParameters(this); }
void Awake() { _instance = this; }
void ReadInputs() { if (IM.Pressed(Inputs.Left)) { MsgAll(new EventMsg(EventType.MonsterMove, null, 0, Inputs.None)); if (!God.GSM.hasKey) { MsgAll(new EventMsg(EventType.KeyMove, null, 0, Inputs.None)); } MsgAll(new EventMsg(EventType.ScoreMove, null, 0, Inputs.None)); MsgAll(new EventMsg(Inputs.Left)); } else if (IM.Pressed(Inputs.Right)) { MsgAll(new EventMsg(EventType.MonsterMove, null, 0, Inputs.None)); if (!God.GSM.hasKey) { MsgAll(new EventMsg(EventType.KeyMove, null, 0, Inputs.None)); } MsgAll(new EventMsg(EventType.ScoreMove, null, 0, Inputs.None)); MsgAll(new EventMsg(Inputs.Right)); } else if (IM.Pressed(Inputs.Up)) { MsgAll(new EventMsg(EventType.MonsterMove, null, 0, Inputs.None)); if (!God.GSM.hasKey) { MsgAll(new EventMsg(EventType.KeyMove, null, 0, Inputs.None)); } MsgAll(new EventMsg(EventType.ScoreMove, null, 0, Inputs.None)); MsgAll(new EventMsg(Inputs.Up)); } else if (IM.Pressed(Inputs.Down)) { MsgAll(new EventMsg(EventType.MonsterMove, null, 0, Inputs.None)); if (!God.GSM.hasKey) { MsgAll(new EventMsg(EventType.KeyMove, null, 0, Inputs.None)); } MsgAll(new EventMsg(EventType.ScoreMove, null, 0, Inputs.None)); MsgAll(new EventMsg(Inputs.Down)); } if (Input.GetKeyUp(KeyCode.S)) { ModelManager.SaveGame(); } if (Input.GetKeyUp(KeyCode.L)) { ModelManager.PendingSave = ModelManager.LoadGame(); if (ModelManager.PendingSave != null) { SceneManager.LoadScene(0); } else { Debug.Log("NO FILE TO LOAD"); } } if (Input.GetKeyUp(KeyCode.D)) { ModelManager.DeleteSave(); } if (Input.GetKeyUp(KeyCode.Space)) { StartCoroutine(ModelManager.CaptureScreenshot("X")); } }
private void WriteMetaSprites(StreamWriter outputFile, CharacterModel model, string name) { ProjectModel projectModel = ModelManager.Get <ProjectModel>(); int nesFPS = projectModel.Header.FrameTiming == FrameTiming.NTSC ? NTSC : PAL; List <string> animationIndices = new List <string>(); foreach (CharacterAnimation animation in model.Animations) { if (string.IsNullOrEmpty(animation.ID)) { continue; } int frameIndex = 0; List <string> frameNames = new List <string>(); for (int i = 0; i < animation.Frames.Length; ++i) { if (animation.Frames[i].Tiles == null) { continue; } string frameName = $"{name}_{animation.Name}_data_{frameIndex++}"; bool foundFrame = false; for (int j = 0; j < animation.Frames[i].Tiles.Length; ++j) { CharacterTile charTile = animation.Frames[i].Tiles[j]; if (string.IsNullOrEmpty(charTile.BankID) || string.IsNullOrEmpty(charTile.BankTileID)) { continue; } if (foundFrame == false) { frameNames.Add(frameName); outputFile.WriteLine($"{frameName}:"); outputFile.WriteLine("; vert tile attr horiz"); foundFrame = true; } byte horiz = (byte)charTile.Point.X; byte vert = (byte)charTile.Point.Y; BankModel bank = ProjectFiles.GetModel <BankModel>(charTile.BankID); byte tile = (byte)bank.GetTileIndex(charTile.BankTileID); int paletteIndex = charTile.PaletteIndex; byte attrs = (byte)paletteIndex; attrs |= charTile.BackBackground ? (byte)32 : (byte)0; attrs |= charTile.FlipX ? (byte)64 : (byte)0; attrs |= charTile.FlipY ? (byte)128 : (byte)0; outputFile.WriteLine($" .byte ${vert:X2}, ${tile:X2}, ${attrs:X2}, ${horiz:X2}"); } if (foundFrame) { // Add the termination byte outputFile.WriteLine(" .byte $FF"); outputFile.WriteLine(""); } } outputFile.WriteLine($"{name}_{animation.Name}_data:"); animationIndices.Add($"{animation.Name}"); int frameDuration = (int)(nesFPS * animation.Speed); int colBoxAx = animation.CollisionInfo == null ? 0 : animation.CollisionInfo.OffsetX; int colBoxAy = animation.CollisionInfo == null ? 0 : animation.CollisionInfo.OffsetY; int colBoxBx = animation.CollisionInfo == null ? 0 : animation.CollisionInfo.OffsetX + animation.CollisionInfo.Width; int colBoxCy = animation.CollisionInfo == null ? 0 : animation.CollisionInfo.OffsetY + animation.CollisionInfo.Height; outputFile.WriteLine($" ; number of frames"); outputFile.WriteLine($" .byte ${frameNames.Count:X2} ; decimal {frameNames.Count}"); outputFile.WriteLine($" ; frame duration"); outputFile.WriteLine($" .byte ${frameDuration:X2} ; decimal {frameDuration}"); outputFile.WriteLine($" ; collision"); outputFile.WriteLine($" ; a____b"); outputFile.WriteLine($" ; | |"); outputFile.WriteLine($" ; |____|"); outputFile.WriteLine($" ; c d"); outputFile.WriteLine($" ; a b c"); outputFile.WriteLine($" ; x y x y"); outputFile.Write($" .byte "); outputFile.Write($"${colBoxAx:X2}, "); outputFile.Write($"${colBoxAy:X2}, "); outputFile.Write($"${colBoxBx:X2}, "); outputFile.Write($"${colBoxCy:X2}"); outputFile.Write(Environment.NewLine); foreach (string frameName in frameNames) { outputFile.WriteLine($" .addr {frameName}"); } outputFile.WriteLine(""); } if (animationIndices.Count > 0) { outputFile.WriteLine("; aninmation indices"); for (int i = 0; i < animationIndices.Count; ++i) { string index = animationIndices[i].ToUpper(); string nameUpper = name.ToUpper(); outputFile.WriteLine($"ANIM_{nameUpper}_{index} = ${i:X2}"); } outputFile.WriteLine(""); outputFile.WriteLine($"{name}_anim_num_map:"); for (int i = 0; i < animationIndices.Count; ++i) { string index = animationIndices[i]; outputFile.WriteLine($" .addr {name}_{index}_data"); } } }
static void Main(string[] args) { ModelManager.CreateModels(); }
private static void AddXTreeItem(XTreeCollection xTreeList, NodeInfo nodeInfo) { s_IsShow = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentPreview, nodeInfo.NodeId); s_IsInput = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentInput, nodeInfo.NodeId); s_IsManage = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentManage, nodeInfo.NodeId); string str = ""; if (!s_IsAdministrator) { if (nodeInfo.ArrChildId.IndexOf(",", StringComparison.Ordinal) > 0) { foreach (NodeInfo info in Nodes.GetNodesListInArrChildId(nodeInfo.ArrChildId)) { s_IsChildNodePurview = (RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentPreview, info.NodeId) || RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentInput, info.NodeId)) || RolePermissions.AccessCheckNodePermission(OperateCode.ContentManage, info.NodeId); if (s_IsChildNodePurview) { break; } } } else { s_EnableAddWhenHasChild = true; } } if (ModelManager.GetNodesModelTemplateRelationShip(nodeInfo.NodeId, DataConverter.CLng(HttpContext.Current.Request["ModelId"])).IsNull) { s_IsInput = false; s_IsManage = false; } if ((s_IsShow || s_IsInput) || (s_IsManage || s_IsChildNodePurview)) { XTreeItem item = new XTreeItem(); item.Text = nodeInfo.NodeName; item.ArrModelId = "0"; item.ArrModelName = ""; item.NodeId = nodeInfo.NodeId.ToString(); item.Target = ""; item.Expand = "0"; if (nodeInfo.Child > 0) { item.XmlSrc = string.Concat(new object[] { "ContentSelectTreeXml.aspx?NodeID=", nodeInfo.NodeId, "&ModelId=", HttpContext.Current.Request["ModelId"] }); } if (!s_IsInput && !s_IsManage) { str = "Forbid"; item.AnchorType = "0"; } else { switch (nodeInfo.PurviewType) { case 0: str = "Container"; break; case 1: str = "HalfOpen"; break; case 2: str = "Purview"; break; default: str = "Container"; break; } item.AnchorType = "2"; if (!s_EnableAddWhenHasChild) { str = "Forbid"; item.AnchorType = "0"; } } item.Icon = str; xTreeList.Add(item); } }
/// <summary> /// Create the OcTree structure from the information of the layer. /// </summary> /// <param name="information">Information of the layer.</param> public void AddLayer(string[,] information) { int depth = Convert.ToInt32(information[0, 0]); int rows = Convert.ToInt32(information[0, 1]); int cols = Convert.ToInt32(information[0, 2]); Vector3 origin = new Vector3( Convert.ToInt32(information[1, 0]), Convert.ToInt32(information[1, 1]), Convert.ToInt32(information[1, 2])); bool found = false; int size = rows > cols ? rows : cols; for (int i = 1; !found; i++) { if (Math.Pow(4, i) < size && Math.Pow(4, i + 1) > size) { size = (int)Math.Pow(4, i + 1); found = true; } } int numberOfDoors = Convert.ToInt32(information[2, 0]); //_doors = new Dictionary<string, KeyValuePair<Vector3, BoundingBox>>(); _doors = new List <Door>(); for (int i = 0; i < numberOfDoors; i++) { Door newDoor = new Door(); newDoor.nextLevel = information[3 + i, 9]; newDoor.neededObject = information[3 + i, 10] != "Null" ? information[3 + i, 10] : null; newDoor.boundingBox = new BoundingBox( new Vector3((float)Convert.ToDouble(information[3 + i, 0]), (float)Convert.ToDouble(information[3 + i, 1]), (float)Convert.ToDouble(information[3 + i, 2])), new Vector3((float)Convert.ToDouble(information[3 + i, 3]), (float)Convert.ToDouble(information[3 + i, 4]), (float)Convert.ToDouble(information[3 + i, 5]))); newDoor.nextPosition = new Vector3((float)Convert.ToDouble(information[3 + i, 6]), (float)Convert.ToDouble(information[3 + i, 7]), (float)Convert.ToDouble(information[3 + i, 8])); _doors.Add(newDoor); } _rootNode = new OcTreeNode(null, new Vector3( origin.X + (rows / 2f) - 0.5f, origin.Y + (cols / 2f) - 0.5f, origin.Z + (depth / 2f) - 0.5f), size); string[] modelInformation; for (int i = 0; i < depth; i++) { for (int j = 0; j < rows; j++) { for (int k = 0; k < cols; k++) { if (information[j + (rows * i) + 3 + numberOfDoors, k] != "Null") { modelInformation = information[j + (rows * i) + 3 + numberOfDoors, k].Split('_'); Vector3 rotation = Vector3.Zero; for (int l = 2; l < modelInformation.Length; l++) { switch (modelInformation[l][0]) { case 'X': rotation.X = MathHelper.ToRadians((float)Convert.ToDouble(modelInformation[l].Split('X')[1])); break; case 'Y': rotation.Y = MathHelper.ToRadians((float)Convert.ToDouble(modelInformation[l].Split('Y')[1])); break; case 'Z': rotation.Z = MathHelper.ToRadians((float)Convert.ToDouble(modelInformation[l].Split('Z')[1])); break; } } AddModel((GameModel)ModelManager.GetModel(modelInformation[0]), new Vector3(j * xSize, k * ySize, i * zSize), rotation, new Vector3(ToInt(modelInformation[1][1]) * xSize, ToInt(modelInformation[1][2]) * ySize, ToInt(modelInformation[1][0]) * zSize)); } } } } RemoveEmpty(); }
protected override void OnMouseDoubleClick(MouseButtonEventArgs e) { base.OnMouseDoubleClick(e); ModelManager.DisplayParameters(this); }
public int SaveModelDetail(ModelUI objUI, System.Data.SqlClient.SqlTransaction objTrans) { int Flag = 0; bool flagTransation = true; ModelDB objDB = new ModelDB(); objDB.Material = objUI.Material; objDB.GroupID = objUI.GroupID; objDB.ModelCategoryID = objUI.ModelCategoryID; objDB.ModelSpecialID = objUI.ModelSpecialID; objDB.ClutchTypeID = objUI.ClutchTypeID; objDB.Description = objUI.Description; DataAccessLayer objDataAccess = new DataAccessLayer(); try { if (objTrans == null) { flagTransation = false; objDataAccess.GetConnection.Open(); SqlTransaction objTransaction = objDataAccess.GetConnection.BeginTransaction(); objTrans = objTransaction; } ModelManager objManager = new ModelManager(); Flag = objManager.SaveModelDetail(objDB, objTrans); if (!flagTransation) objTrans.Commit(); return Flag; } catch (Exception ex) { if (!flagTransation) objTrans.Rollback(); throw ex; } finally { objDataAccess.GetConnection.Close(); } }
public void createGeometry() { ModelManager instance = ModelManager.getInstance(); Appearance appearance1 = instance.getAppearance(0); Appearance appearance2 = instance.getAppearance(1); this.m_appWallAlpha = instance.getAppearance(2); this.m_appWallReplace = appearance2; SimWorld simWorld = AppEngine.getCanvas().getSimWorld(); int length1 = JMath.min(6, this.m_sizeX >> 1); int length2 = JMath.min(6, this.m_sizeZ >> 1); this.m_wallWindows[0] = new MapObject[length1]; this.m_wallWindows[2] = new MapObject[length1]; this.m_wallWindows[1] = new MapObject[length2]; this.m_wallWindows[3] = new MapObject[length2]; for (int index = 0; index <= this.m_sizeX; ++index) { int tileX = this.m_posX + index; int posZ = this.m_posZ; AppEngine.appendUnique(simWorld.registerWall(this, 0, tileX, posZ), this.m_wallWindows[0], (MapObject)null); int tileZ = this.m_posZ + this.m_sizeZ; AppEngine.appendUnique(simWorld.registerWall(this, 2, tileX, tileZ), this.m_wallWindows[2], (MapObject)null); } for (int index = 0; index <= this.m_sizeZ; ++index) { int tileZ = this.m_posZ + index; int posX = this.m_posX; AppEngine.appendUnique(simWorld.registerWall(this, 3, posX, tileZ), this.m_wallWindows[3], (MapObject)null); int tileX = this.m_posX + this.m_sizeX; AppEngine.appendUnique(simWorld.registerWall(this, 1, tileX, tileZ), this.m_wallWindows[1], (MapObject)null); } GeomStrip[] geomStripArray = new GeomStrip[25]; for (int index = 0; index < geomStripArray.Length; ++index) { geomStripArray[index] = new GeomStrip(); } GeomStrip geomStrip1 = geomStripArray[24]; this.m_group = new Group(); int[] floorTexCoords = simWorld.getFloorTexCoords(this.m_floorType); int[] wallTexCoords1 = simWorld.getWallTexCoords(this.m_wallType); int[] wallTexCoords2 = simWorld.getWallTexCoords(46); int[] wallTexCoords3 = simWorld.getWallTexCoords(27); int panelX1 = this.m_posX * 32; int panelZ1 = this.m_posZ * 32; int panelW1 = this.m_sizeX * 32; int panelH1 = this.m_sizeZ * 32; int num1 = 18; geomStrip1.addFloor(panelX1, panelZ1, panelW1, panelH1, floorTexCoords, num1, num1, num1, num1); geomStrip1.addFloor(panelX1, panelZ1, 32, 32, floorTexCoords, 2, 14, 2, 14, 5); geomStrip1.addFloor(panelX1, panelZ1, panelW1, 32, floorTexCoords, 18, 18, 2, 14, 4); geomStrip1.addFloor(panelX1 + panelW1 - 32, panelZ1, 32, 32, floorTexCoords, 14, 2, 2, 14, 6); geomStrip1.addFloor(panelX1 + panelW1 - 32, panelZ1, 32, panelH1, floorTexCoords, 14, 2, 18, 18, 2); geomStrip1.addFloor(panelX1 + panelW1 - 32, panelZ1 + panelH1 - 32, 32, 32, floorTexCoords, 14, 2, 14, 2, 10); geomStrip1.addFloor(panelX1, panelZ1 + panelH1 - 32, panelW1, 32, floorTexCoords, 18, 18, 14, 2, 8); geomStrip1.addFloor(panelX1, panelZ1 + panelH1 - 32, 32, 32, floorTexCoords, 2, 14, 14, 2, 9); geomStrip1.addFloor(panelX1, panelZ1, 32, panelH1, floorTexCoords, 2, 14, 18, 18, 1); for (int index1 = 0; index1 < 4; ++index1) { int index2 = index1 * 6; GeomStrip geomStrip2 = geomStripArray[index2 + 2]; GeomStrip geomStrip3 = geomStripArray[index2]; GeomStrip geomStrip4 = geomStripArray[index2 + 1]; GeomStrip geomStrip5 = geomStripArray[index2 + 5]; GeomStrip geomStrip6 = geomStripArray[index2 + 3]; GeomStrip geomStrip7 = geomStripArray[index2 + 4]; int num2 = 0; int num3 = 0; int num4 = 0; int num5 = 0; int num6 = 0; GeomStrip.Dir dir1 = GeomStrip.Dir.DIR_X_POS; int num7 = 0; int num8 = 0; GeomStrip.Dir dir2 = GeomStrip.Dir.DIR_X_POS; switch (index1) { case 0: num2 = this.m_posX; num3 = this.m_posZ; num6 = this.m_sizeX; dir1 = GeomStrip.Dir.DIR_X_POS; num7 = 1; num4 = this.m_posX * 32; num5 = this.m_posZ * 32 + 2; dir2 = GeomStrip.Dir.DIR_X_NEG; break; case 1: num2 = this.m_posX + this.m_sizeX; num3 = this.m_posZ; num6 = this.m_sizeZ; dir1 = GeomStrip.Dir.DIR_Z_POS; num8 = 1; num4 = this.m_posX * 32 + this.m_sizeX * 32 - 2; num5 = this.m_posZ * 32; dir2 = GeomStrip.Dir.DIR_Z_NEG; break; case 2: num2 = this.m_posX + this.m_sizeX - 1; num3 = this.m_posZ + this.m_sizeZ; num6 = this.m_sizeX; dir1 = GeomStrip.Dir.DIR_X_NEG; num7 = -1; num4 = this.m_posX * 32 + this.m_sizeX * 32; num5 = this.m_posZ * 32 + this.m_sizeZ * 32 - 2; dir2 = GeomStrip.Dir.DIR_X_POS; break; case 3: num2 = this.m_posX; num3 = this.m_posZ + this.m_sizeZ - 1; num6 = this.m_sizeZ; dir1 = GeomStrip.Dir.DIR_Z_NEG; num8 = -1; num4 = this.m_posX * 32 + 2; num5 = this.m_posZ * 32 + this.m_sizeZ * 32; dir2 = GeomStrip.Dir.DIR_Z_POS; break; } int num9 = -num8; int num10 = num7; int tileX = num2; int tileZ = num3; int panelX2 = num4; int panelZ2 = num5; bool flag1 = false; bool flag2 = false; bool flag3 = false; bool flag4 = false; bool flag5 = false; bool flag6 = false; bool flag7 = false; bool flag8 = false; int num11 = 0; int num12 = 0; int panelW2 = 0; int num13 = 0; int num14 = 0; int num15 = 0; int num16 = 0; int num17 = 0; int panelW3 = 0; for (int index3 = 0; index3 < num6; ++index3) { int attribute = simWorld.getAttribute(tileX, tileZ); bool flag9 = (attribute & 3840) != 0; bool flag10 = (attribute & 64) != 0; bool flag11 = !flag10 && (attribute & 32) != 0; bool flag12 = (attribute & 128) != 0; bool flag13 = (simWorld.getAttribute(tileX - num9, tileZ - num10) & 16) == 0; bool flag14 = flag9 && flag13; if (flag9 && !flag1 || (flag5 || flag4)) { num11 = panelX2; num12 = panelZ2; panelW2 = 0; } if (!flag9 && flag1) { num13 = panelX2; num14 = panelZ2; num15 = 0; } if (flag14 && !flag2 || (flag5 || flag4)) { num16 = panelX2; num17 = panelZ2; panelW3 = 0; flag6 = flag3; flag7 = flag4; flag8 = flag5; } if (flag9) { panelW2 += 32; } else { num15 += 32; } if (flag14) { panelW3 += 32; } if (flag10) { geomStrip2.addDoorWall(panelX2, panelZ2, 32, dir1, wallTexCoords1, 0, 0); geomStrip2.addTallWallTop(panelX2, panelZ2, 32, dir1, wallTexCoords2, 0, 0); if (flag13) { int num18 = num16 + num7 * panelW3 - num9 * 4; int num19 = num17 + num8 * panelW3 - num10 * 4; int panelX3 = num18 + num7 * 32; int panelZ3 = num19 + num8 * 32; geomStrip5.addDoorWall(panelX3, panelZ3, 32, dir2, wallTexCoords3, 0, 0); geomStrip5.addTallWallTop(panelX3, panelZ3, 32, dir2, wallTexCoords2, 0, 0); } } if (panelW2 > 0 && (flag12 && flag9 || !flag9 && flag1 || index3 == num6 - 1)) { int panelX3 = num11; int panelZ3 = num12; int flags = 0; int trimStart = 0; int trimEnd = 0; if (num11 == num4 && num12 == num5) { trimStart = 2; flags |= 1; } if (index3 == num6 - 1) { trimEnd = 2; flags |= 2; } if (flag12) { geomStrip2.addWindowWall(panelX2, panelZ2, 32, dir1, wallTexCoords1, 0, 0); geomStrip2.addTallWallTop(panelX2, panelZ2, 32, dir1, wallTexCoords2, 0, 0); geomStrip3.addShortWall(panelX2, panelZ2, 32, dir1, wallTexCoords1, 0, 0); geomStrip4.addShortWallTop(panelX2, panelZ2, 32, dir1, wallTexCoords2, 0, 0); panelW2 -= 32; } if (panelW2 > 0) { geomStrip2.addTallWall(panelX3, panelZ3, panelW2, dir1, wallTexCoords1, trimStart, trimEnd, flags); geomStrip2.addTallWallTop(panelX3, panelZ3, panelW2, dir1, wallTexCoords2, trimStart, trimEnd); geomStrip3.addShortWall(panelX3, panelZ3, panelW2, dir1, wallTexCoords1, trimStart, trimEnd, flags); geomStrip4.addShortWallTop(panelX3, panelZ3, panelW2, dir1, wallTexCoords2, trimStart, trimEnd); if (!flag8 && !flag7) { int panelX4 = panelX3 + num7 * trimStart; int panelZ4 = panelZ3 + num8 * trimStart; geomStrip2.addTallCap(panelX4, panelZ4, dir1, wallTexCoords2); geomStrip4.addShortCap(panelX4, panelZ4, dir1, wallTexCoords2); } if (!flag12 && !flag10) { int panelX4 = panelX3 + -num9 * 2 + num7 * (panelW2 - trimEnd); int panelZ4 = panelZ3 + -num10 * 2 + num8 * (panelW2 - trimEnd); geomStrip2.addTallCap(panelX4, panelZ4, dir2, wallTexCoords2); geomStrip4.addShortCap(panelX4, panelZ4, dir2, wallTexCoords2); } } } if (num15 > 0 && flag9 && !flag1) { int panelX3 = 0; int panelZ3 = 0; int panelW4 = 0; int panelH2 = 0; int trimStartX = 0; int trimEndX = 0; int trimStartZ = 0; int trimEndZ = 0; switch (dir1) { case GeomStrip.Dir.DIR_X_POS: panelX3 = num13; panelZ3 = num14 - 2; panelW4 = num15; panelH2 = 32; trimStartZ = 0; trimEndZ = 30; break; case GeomStrip.Dir.DIR_Z_POS: panelX3 = num13 - 32 + 2; panelZ3 = num14; panelW4 = 32; panelH2 = num15; trimStartX = 30; trimEndX = 0; break; case GeomStrip.Dir.DIR_X_NEG: panelX3 = num13 - num15; panelZ3 = num14 - 32 + 2; panelW4 = num15; panelH2 = 32; trimStartZ = 30; trimEndZ = 0; break; case GeomStrip.Dir.DIR_Z_NEG: panelX3 = num13 - 2; panelZ3 = num14 - num15; panelW4 = 32; panelH2 = num15; trimStartX = 0; trimEndX = 30; break; } geomStrip1.addFloor(panelX3, panelZ3, panelW4, panelH2, floorTexCoords, trimStartX, trimEndX, trimStartZ, trimEndZ, 15); } if (panelW3 > 0 && ((flag12 || flag10) && flag14 || (!flag14 && flag2 || flag14 && index3 == num6 - 1))) { int panelX3 = num16 + num7 * panelW3 - num9 * 4; int panelZ3 = num17 + num8 * panelW3 - num10 * 4; int trimEnd = flag6 || flag8 || flag7 ? 0 : 2; int trimStart = flag11 || flag12 || flag10 ? 0 : 2; if (flag12) { geomStrip5.addWindowWall(panelX3, panelZ3, 32, dir2, wallTexCoords3, 0, 0); geomStrip5.addTallWallTop(panelX3, panelZ3, 32, dir2, wallTexCoords2, 0, 0); geomStrip6.addShortWall(panelX3, panelZ3, 32, dir2, wallTexCoords3, 0, 0); geomStrip7.addShortWallTop(panelX3, panelZ3, 32, dir2, wallTexCoords2, 0, 0); panelW3 -= 32; panelX3 += -num7 * 32; panelZ3 += -num8 * 32; } if (panelW3 > 0) { geomStrip5.addTallWall(panelX3, panelZ3, panelW3, dir2, wallTexCoords3, trimStart, trimEnd); geomStrip5.addTallWallTop(panelX3, panelZ3, panelW3, dir2, wallTexCoords2, trimStart, trimEnd); geomStrip6.addShortWall(panelX3, panelZ3, panelW3, dir2, wallTexCoords3, trimStart, trimEnd); geomStrip7.addShortWallTop(panelX3, panelZ3, panelW3, dir2, wallTexCoords2, trimStart, trimEnd); if (!flag12 && !flag10) { int panelX4 = panelX3 - num7 * trimStart; int panelZ4 = panelZ3 - num8 * trimStart; geomStrip5.addTallCap(panelX4, panelZ4, dir2, wallTexCoords2); geomStrip6.addShortCap(panelX4, panelZ4, dir2, wallTexCoords2); } if (!flag8 && !flag7) { int panelX4 = panelX3 + num9 * 2 + -num7 * (panelW3 - trimEnd); int panelZ4 = panelZ3 + num10 * 2 + -num8 * (panelW3 - trimEnd); geomStrip5.addTallCap(panelX4, panelZ4, dir1, wallTexCoords2); geomStrip6.addShortCap(panelX4, panelZ4, dir1, wallTexCoords2); } } } flag1 = flag9; flag2 = flag14; flag3 = flag11; flag4 = flag10; flag5 = flag12; tileX += num7; tileZ += num8; panelX2 += num7 * 32; panelZ2 += num8 * 32; } } GeomStrip[] subGeomStrips = new GeomStrip[25]; for (int index = 0; index < 25; ++index) { subGeomStrips[index] = (GeomStrip)null; if (geomStripArray[index].getQuadCount() > 0) { subGeomStrips[index] = geomStripArray[index]; } } this.m_compositeMesh = GeomStrip.createMesh(subGeomStrips); this.m_compositeMesh.setAppearance(24, appearance1); this.m_group.addChild((Node)this.m_compositeMesh); for (int wall = 0; wall < 4; ++wall) { this.m_wallAlphasF8[wall] = 0; this.updateWallAlpha(wall, (int)byte.MaxValue, 0); } }
private void OnConnectorsChanged(object sender, NotifyCollectionChangedEventArgs e) { ModelManager.RedrawModel(this); }
private static EFArtifact GetArtifactForValidation(Uri uri, IVsHierarchy hierarchy, ModelManager modelManager) { IServiceProvider oleServiceProvider = null; var modelListener = PackageManager.Package.ModelChangeEventListener; hierarchy.GetSite(out oleServiceProvider); System.IServiceProvider sp = new ServiceProvider(oleServiceProvider); var escherDocData = VSHelpers.GetDocData(sp, uri.LocalPath) as IEntityDesignDocData; EFArtifact artifact = null; // // If we opened the document with Escher, then use the XmlEditor's xlinq tree // If we opened the document with the xml editor, but not escher, then // we don't want to use the XmlEditor's xlinq tree, because then we would be receiving events when // the document changes, and we currently don't support that. // if (escherDocData != null) { artifact = PackageManager.Package.ModelManager.GetNewOrExistingArtifact( uri, new VSXmlModelProvider(PackageManager.Package, PackageManager.Package)); if (modelListener != null) { modelListener.OnBeforeValidateModel(VSHelpers.GetProject(hierarchy), artifact, true); } } else { if (Path.GetExtension(uri.LocalPath).Equals(EntityDesignArtifact.ExtensionEdmx, StringComparison.OrdinalIgnoreCase)) { // no doc data exists for this document, so load it into a temp model manager that can be disposed of when we're done. // Using the LoaderBasedXmlModelProvider will let us catch XML scanner and parser errors (the xml editor will try to // recover from these, and we won't know that the problem occurred. artifact = modelManager.GetNewOrExistingArtifact(uri, new StandaloneXmlModelProvider(PackageManager.Package)); if (modelListener != null) { modelListener.OnBeforeValidateModel(VSHelpers.GetProject(hierarchy), artifact, true); } } } return(artifact); }
public static void Init() { Material = new MaterialManager(); Models = new ModelManager(); }
void RenderOpaque() { Common.Device.DepthStencilState = DepthStencilState.Default; ModelManager.RenderOpaque(); }
public ModelEntity(string modelPath) : base() { Model = ModelLoader.LoadModel(modelPath); ModelManager.Register(this, Model.Key); }
public void EnterStdSpecNotes() { ModelManager test = new ModelManager(driver); test.EnterStdSpecNotes(); }
public SacredStar(Players owner, Vector2 pos, int gridSize) : base(ModelManager.GetInstance().SacredStar, UnitTypes.SacredStar, owner, pos, 0f, gridSize) { mTakeOverManager = new TakeOverManager(Position); mIsApplied = false; }
public override void Close() { archive.Close(); wdt = null; wdtf = null; modelmanager = null; wmomanager = null; zoneToMapId = null; mapIdToFile = null; areaIdToName = null; archive = null; base.Close(); }
/// <summary> /// Returns instance of YoloModel model instantiated from exported model path. /// </summary> /// <param name="path">Exported model directory.</param> public YoloModel(string path) { manager = new ModelManager(path, true); manager.InitModel(modelName, int.MaxValue); }
public static void init(Game game) { modelManager = new ModelManager(game); }
public CharacterManager() { ModelDirector = new ModelManager (); }