Inheritance: IJobSource, IJobObserver, INotifyPropertyChanged
Example #1
0
        void ISaveGameDelegate.RestoreSaveData(object _data)
        {
            var data = (ItemObjectClientData)_data;

            if (data.BuildItemManager != null)
            {
                BuildItemManager.AddBuildItemManager(data.BuildItemManager);
            }
        }
Example #2
0
		public static BuildItemManager FindOrCreateBuildItemManager(ItemObject workbench)
		{
			var mgr = s_buildItemManagers.FirstOrDefault(m => m.Workbench == workbench);

			if (mgr == null)
			{
				mgr = new BuildItemManager(workbench);
				s_buildItemManagers.Add(mgr);
			}

			return mgr;
		}
Example #3
0
        object ISaveGameDelegate.GetSaveData()
        {
            ItemObjectClientData data = null;

            if (this.ItemCategory == Dwarrowdelf.ItemCategory.Workbench)
            {
                var buildItemManager = BuildItemManager.FindBuildItemManager(this);
                if (buildItemManager != null)
                {
                    if (data == null)
                    {
                        data = new ItemObjectClientData();
                    }

                    data.BuildItemManager = buildItemManager;
                }
            }

            return(data);
        }
Example #4
0
 static void RemoveBuildItemManager(BuildItemManager mgr)
 {
     var ok = s_buildItemManagers.Remove(mgr);
     Debug.Assert(ok);
 }
Example #5
0
        internal static void AddBuildItemManager(BuildItemManager manager)
        {
            Debug.Assert(s_buildItemManagers.All(bim => bim.Workbench != manager.Workbench));

            s_buildItemManagers.Add(manager);
        }
Example #6
0
        public static BuildItemManager FindOrCreateBuildItemManager(ItemObject workbench)
        {
            var mgr = s_buildItemManagers.FirstOrDefault(m => m.Workbench == workbench);

            if (mgr == null)
            {
                mgr = new BuildItemManager(workbench);
                s_buildItemManagers.Add(mgr);
            }

            return mgr;
        }
Example #7
0
		static void RemoveBuildItemManager(BuildItemManager mgr)
		{
			var ok = s_buildItemManagers.Remove(mgr);
			Debug.Assert(ok);
		}
Example #8
0
		internal static void AddBuildItemManager(BuildItemManager manager)
		{
			Debug.Assert(s_buildItemManagers.All(bim => bim.Workbench != manager.Workbench));

			s_buildItemManagers.Add(manager);
		}