Changeset 325 for binary-improvements/7dtd-server-fixes/src/LiveData
- Timestamp:
- Sep 4, 2018, 1:00:48 PM (6 years ago)
- Location:
- binary-improvements/7dtd-server-fixes/src/LiveData
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/src/LiveData/Animals.cs
r312 r325 1 using System; 2 using System.Collections.Generic; 3 4 namespace AllocsFixes.LiveData 5 { 6 public class Animals : EntityFilterList<EntityAnimal> 7 { 8 1 namespace AllocsFixes.LiveData { 2 public class Animals : EntityFilterList<EntityAnimal> { 9 3 public static readonly Animals Instance = new Animals (); 10 4 11 5 protected override EntityAnimal predicate (Entity _e) { 12 6 if (_e is EntityAnimal) { 13 EntityAnimal ea = (EntityAnimal) _e;7 EntityAnimal ea = (EntityAnimal) _e; 14 8 15 9 if (ea.IsAlive ()) { … … 17 11 } 18 12 } 13 19 14 return null; 20 15 } 21 22 } 16 } 23 17 } 24 -
binary-improvements/7dtd-server-fixes/src/LiveData/EntityFilterList.cs
r312 r325 2 2 using System.Collections.Generic; 3 3 4 namespace AllocsFixes.LiveData 5 { 6 public abstract class EntityFilterList<T> where T: Entity 7 { 4 namespace AllocsFixes.LiveData { 5 public abstract class EntityFilterList<T> where T : Entity { 8 6 public void Get (List<T> _list) { 9 7 _list.Clear (); … … 18 16 } 19 17 } 20 } 21 catch (Exception e) { 18 } catch (Exception e) { 22 19 Log.Exception (e); 23 20 } … … 35 32 } 36 33 } 37 } 38 catch (Exception e) { 34 } catch (Exception e) { 39 35 Log.Exception (e); 40 36 } 37 41 38 return count; 42 39 } 43 40 44 41 protected abstract T predicate (Entity _e); 45 46 } 42 } 47 43 } 48 -
binary-improvements/7dtd-server-fixes/src/LiveData/Hostiles.cs
r312 r325 1 using System; 2 using System.Collections.Generic; 3 4 namespace AllocsFixes.LiveData 5 { 6 public class Hostiles : EntityFilterList<EntityEnemy> 7 { 8 1 namespace AllocsFixes.LiveData { 2 public class Hostiles : EntityFilterList<EntityEnemy> { 9 3 public static readonly Hostiles Instance = new Hostiles (); 10 4 11 override protectedEntityEnemy predicate (Entity _e) {5 protected override EntityEnemy predicate (Entity _e) { 12 6 if (_e is EntityEnemy) { 13 7 if (_e.IsAlive ()) { … … 15 9 } 16 10 } 11 17 12 return null; 18 13 } 19 20 14 } 21 15 } 22
Note:
See TracChangeset
for help on using the changeset viewer.