Exemplo n.º 1
0
        public T ImportRessource <T>(string ressourceID) where T : IRessource
        {
            if (!ManagedRessources.ContainsKey(ressourceID))
            {
                Debugger.WriteLog($"Importing : '{ressourceID}'...", LogType.Info, nameof(RessourceManager));
                string             ressourceTypeName = ressourceID.Split(':')[0];
                IRessourceImporter importer          = Importers[ressourceTypeName];
                IRessource         ressource         = importer.Import(this, $"{RessourceFolderName}/{ressourceTypeName}/{ressourceID.Split(':')[1]}");
                if (ressource != null)
                {
                    ManagedRessources[ressourceID] = ressource;
                }
                else
                {
                    throw new Exception($"Cannot import '{ressourceID}' with '{Importers}'. The importer return a 'null'!");
                }
            }

            return((T)ManagedRessources[ressourceID]);
        }
Exemplo n.º 2
0
 public LongView(IRessource ressource) : base(ressource)
 {
 }
Exemplo n.º 3
0
		///	<summary> 
		///		This method copy's each database field which is in the <paramref name="includedColumns"/> 
		///		from the <paramref name="source"/> interface to this data row.
		/// </summary>
		public void Copy_From_But_TakeOnly(IRessource source, params string[] includedColumns)
		{
			if (includedColumns.Contains(RessourcesTable.IdCol)) this.Id = source.Id;
			if (includedColumns.Contains(RessourcesTable.NameIdCol)) this.NameId = source.NameId;
			if (includedColumns.Contains(RessourcesTable.DescriptionCol)) this.Description = source.Description;
			if (includedColumns.Contains(RessourcesTable.MainAdresseCol)) this.MainAdresse = source.MainAdresse;
			if (includedColumns.Contains(RessourcesTable.MainAdresseDescriptionCol)) this.MainAdresseDescription = source.MainAdresseDescription;
			if (includedColumns.Contains(RessourcesTable.AdresseCol)) this.Adresse = source.Adresse;
			if (includedColumns.Contains(RessourcesTable.AdresseDescriptionCol)) this.AdresseDescription = source.AdresseDescription;
			if (includedColumns.Contains(RessourcesTable.BookingGroupCol)) this.BookingGroup = source.BookingGroup;
			if (includedColumns.Contains(RessourcesTable.DisplayOnCol)) this.DisplayOn = source.DisplayOn;
			if (includedColumns.Contains(RessourcesTable.ZusatzInfoCol)) this.ZusatzInfo = source.ZusatzInfo;
			if (includedColumns.Contains(RessourcesTable.TypBloHalSauPlaCol)) this.TypBloHalSauPla = source.TypBloHalSauPla;
			if (includedColumns.Contains(RessourcesTable.TypBloHalSauPlaMultiCol)) this.TypBloHalSauPlaMulti = source.TypBloHalSauPlaMulti;
		}
Exemplo n.º 4
0
		///	<summary> This method copy's each database field from the <paramref name="source"/> interface to this data row.</summary>
		public void Copy_From(IRessource source, bool includePrimaryKey = false)
		{
			if (includePrimaryKey) this.Id = source.Id;
			this.NameId = source.NameId;
			this.Description = source.Description;
			this.MainAdresse = source.MainAdresse;
			this.MainAdresseDescription = source.MainAdresseDescription;
			this.Adresse = source.Adresse;
			this.AdresseDescription = source.AdresseDescription;
			this.BookingGroup = source.BookingGroup;
			this.DisplayOn = source.DisplayOn;
			this.ZusatzInfo = source.ZusatzInfo;
			this.TypBloHalSauPla = source.TypBloHalSauPla;
			this.TypBloHalSauPlaMulti = source.TypBloHalSauPlaMulti;
		}
Exemplo n.º 5
0
		///	<summary> This method copy's each database field into the <paramref name="target"/> interface. </summary>
		public void Copy_To(IRessource target, bool includePrimaryKey = false)
		{
			if (includePrimaryKey) target.Id = this.Id;
			target.NameId = this.NameId;
			target.Description = this.Description;
			target.MainAdresse = this.MainAdresse;
			target.MainAdresseDescription = this.MainAdresseDescription;
			target.Adresse = this.Adresse;
			target.AdresseDescription = this.AdresseDescription;
			target.BookingGroup = this.BookingGroup;
			target.DisplayOn = this.DisplayOn;
			target.ZusatzInfo = this.ZusatzInfo;
			target.TypBloHalSauPla = this.TypBloHalSauPla;
			target.TypBloHalSauPlaMulti = this.TypBloHalSauPlaMulti;
		}
Exemplo n.º 6
0
 public ShortView(IRessource ressource) : base(ressource)
 {
 }
Exemplo n.º 7
0
 public View(IRessource ressource)
 {
     _ressource = ressource;
 }
Exemplo n.º 8
0
 public void RemoveRessource(IRessource ressource)
 {
     mapRows[ressource.SpawnY][ressource.SpawnX] = MapCellType.Terrain;
 }
Exemplo n.º 9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RessourceNodeXmlBuilder" /> class.
 /// </summary>
 /// <param name="ressource">
 /// The ressource.
 /// </param>
 public RessourceNodeXmlBuilder(IRessource ressource)
 {
     this._ressource = ressource;
 }