1 /*
2 * WeaponDAOImpl.java
3 *
4 * Created on February 11, 2003, 10:37 AM
5 */
6
7 package com.mlw.fps.model.business.dao.memmory;
8
9 import java.util.Collection;
10
11 import com.mlw.fps.model.business.dao.WeaponDAO;
12 import com.mlw.fps.model.business.vo.Weapon;
13
14 /***
15 *
16 * @author Matthew Wilson
17 */
18 public class WeaponDAOImpl implements WeaponDAO
19 {
20
21 /*** Creates a new instance of WeaponDAOImpl
22 */
23 public WeaponDAOImpl()
24 {
25 }
26
27 public Weapon getWeaponByPk(String weaponPk)
28 {
29 return (Weapon)StaticData.instance().getWeapons().get(weaponPk);
30 }
31
32 public Collection getWeapons()
33 {
34 return StaticData.instance().getWeaponsByName().values();
35 }
36
37 public Weapon getWeaponByName(String name)
38 {
39 return (Weapon)StaticData.instance().getWeaponsByName().get(name);
40 }
41
42 public void insert(Weapon weapon)
43 {
44 if( weapon.getPk()==null) weapon.setPk(StaticData.instance().next());
45
46 StaticData.instance().getWeapons().put(weapon.getPk(),weapon);
47 StaticData.instance().getWeaponsByName().put(weapon.getName(),weapon);
48 }
49
50 }
This page was automatically generated by Maven