-
Notifications
You must be signed in to change notification settings - Fork 0
/
ResourceFactory.cs
35 lines (31 loc) · 1.31 KB
/
ResourceFactory.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
class ResourceFactory
{
internal static PlayerItem CreatePlayerItemForResource(GameTown gameTown, string resourceName)
{
float multi = GameZone.rewardMultiplier;
int mPrice = gameTown.GetFinalProductionOffer(resourceName, multi);
PlayerItem playerItem = new PlayerItem();
playerItem.name = Localization.Format("Shipment of", Localization.Get(resourceName));
playerItem.info = Localization.Format("Loaded in", gameTown.name);
playerItem.gold = mPrice;
playerItem.SetStat(resourceName, 1);
playerItem.SetStat("Level", GameZone.challengeLevel);
playerItem.type = "Shipment";
return playerItem;
}
internal static PlayerItem CreatePlayerItemForResource(GameTown gameTown, string resourceName, int purchasePrice)
{
PlayerItem playerItem = new PlayerItem();
playerItem.name = Localization.Format("Shipment of", Localization.Get(resourceName));
playerItem.info = Localization.Format("Loaded in", gameTown.name);
playerItem.gold = purchasePrice;
playerItem.type = "Shipment";
playerItem.SetStat(resourceName, 1);
playerItem.SetStat("Level", GameZone.challengeLevel);
return playerItem;
}
}