Skip to content

Commit

Permalink
get by name (Anuken#6396)
Browse files Browse the repository at this point in the history
  • Loading branch information
MEEPofFaith authored Dec 2, 2021
1 parent 8cb830b commit 5ea4688
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion core/src/mindustry/core/ContentLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,10 @@ public Item item(int id){
return getByID(ContentType.item, id);
}

public Item item(String name){
return getByName(ContentType.item, name);
}

public Seq<Liquid> liquids(){
return getBy(ContentType.liquid);
}
Expand All @@ -272,6 +276,10 @@ public Liquid liquid(int id){
return getByID(ContentType.liquid, id);
}

public Liquid liquid(String name){
return getByName(ContentType.liquid, name);
}

public Seq<BulletType> bullets(){
return getBy(ContentType.bullet);
}
Expand All @@ -284,10 +292,18 @@ public Seq<StatusEffect> statusEffects(){
return getBy(ContentType.status);
}

public StatusEffect statusEffect(String name){
return getByName(ContentType.status, name);
}

public Seq<SectorPreset> sectors(){
return getBy(ContentType.sector);
}

public SectorPreset sector(String name){
return getByName(ContentType.sector, name);
}

public Seq<UnitType> units(){
return getBy(ContentType.unit);
}
Expand All @@ -296,7 +312,15 @@ public UnitType unit(int id){
return getByID(ContentType.unit, id);
}

public UnitType unit(String name){
return getByName(ContentType.unit, name);
}

public Seq<Planet> planets(){
return getBy(ContentType.planet);
}
}

public Planet planet(String name){
return getByName(ContentType.planet, name);
}
}

0 comments on commit 5ea4688

Please sign in to comment.