Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ChumBucketProjectileHelper.cs
Go to the documentation of this file.
1
using
System.Collections.Generic
;
2
using
Microsoft.Xna.Framework
;
3
4
namespace
Terraria.GameContent
;
5
6
public
class
ChumBucketProjectileHelper
7
{
8
private
Dictionary<Point, int>
_chumCountsPendingForThisFrame
=
new
Dictionary<Point, int>
();
9
10
private
Dictionary<Point, int>
_chumCountsFromLastFrame
=
new
Dictionary<Point, int>
();
11
12
public
void
OnPreUpdateAllProjectiles
()
13
{
14
Utils
.Swap(
ref
_chumCountsPendingForThisFrame
,
ref
_chumCountsFromLastFrame
);
15
_chumCountsPendingForThisFrame
.
Clear
();
16
}
17
18
public
void
AddChumLocation
(
Vector2
spot
)
19
{
20
Point
key =
spot
.ToTileCoordinates();
21
int
value = 0;
22
_chumCountsPendingForThisFrame
.
TryGetValue
(key,
out
value);
23
value++;
24
_chumCountsPendingForThisFrame
[key] = value;
25
}
26
27
public
int
GetChumsInLocation
(
Point
tileCoords
)
28
{
29
int
value = 0;
30
_chumCountsFromLastFrame
.
TryGetValue
(
tileCoords
,
out
value);
31
return
value;
32
}
33
}
System.Collections.Generic.Dictionary.TryGetValue
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
Definition
Dictionary.cs:1419
System.Collections.Generic.Dictionary.Clear
void Clear()
Definition
Dictionary.cs:904
System.Collections.Generic.Dictionary
Definition
Dictionary.cs:14
Terraria.GameContent.ChumBucketProjectileHelper._chumCountsFromLastFrame
Dictionary< Point, int > _chumCountsFromLastFrame
Definition
ChumBucketProjectileHelper.cs:10
Terraria.GameContent.ChumBucketProjectileHelper.AddChumLocation
void AddChumLocation(Vector2 spot)
Definition
ChumBucketProjectileHelper.cs:18
Terraria.GameContent.ChumBucketProjectileHelper._chumCountsPendingForThisFrame
Dictionary< Point, int > _chumCountsPendingForThisFrame
Definition
ChumBucketProjectileHelper.cs:8
Terraria.GameContent.ChumBucketProjectileHelper.GetChumsInLocation
int GetChumsInLocation(Point tileCoords)
Definition
ChumBucketProjectileHelper.cs:27
Terraria.GameContent.ChumBucketProjectileHelper.OnPreUpdateAllProjectiles
void OnPreUpdateAllProjectiles()
Definition
ChumBucketProjectileHelper.cs:12
Terraria.GameContent.ChumBucketProjectileHelper
Definition
ChumBucketProjectileHelper.cs:7
Terraria.Utils
Definition
Utils.cs:29
Microsoft.Xna.Framework
Definition
AlphaTestEffect.cs:1
System.Collections.Generic
Definition
IHashKeyCollection.cs:1
Terraria.GameContent
Definition
AchievementsHelper.cs:1
Microsoft.Xna.Framework.Point
Definition
Point.cs:12
Microsoft.Xna.Framework.Vector2
Definition
Vector2.cs:12
source
Terraria.GameContent
ChumBucketProjectileHelper.cs
Generated by
1.10.0