Changeset 6617 for 2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabriel/Player.cs
- Timestamp:
- 2015-06-30 16:47:41 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabriel/Player.cs
r6549 r6617 6 6 public Dictionary<Direction, Animation> SwingAnimations { get; set; } 7 7 8 public Item ActiveItem { get; set; } 8 public Dictionary<Direction, Animation> ShootAnimations { get; set; } 9 10 public Item Sword { get; set; } 11 12 public Item ActiveItem 13 { 14 get 15 { 16 if (activeItemIndex < Inventory.Count) 17 { 18 return Inventory[activeItemIndex]; 19 } 20 return null; 21 } 22 } 23 24 private int activeItemIndex = 0; 25 26 public List<Item> Inventory { get; private set; } 9 27 10 28 public Player() 11 29 : base(TheLegendOfGabriel.TILE_SIZE, TheLegendOfGabriel.TILE_SIZE) 12 30 { 31 Inventory = new List<Item>(); 13 32 SwingAnimations = new Dictionary<Direction, Animation>(); 33 ShootAnimations = new Dictionary<Direction, Animation>(); 14 34 CollisionIgnoreGroup = 1; 35 } 36 37 public void CycleItems() 38 { 39 activeItemIndex++; 40 if (activeItemIndex >= Inventory.Count) 41 { 42 activeItemIndex = 0; 43 } 15 44 } 16 45
Note: See TracChangeset
for help on using the changeset viewer.