You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

Chest.cs 901 B

12345678910111213141516171819202122232425262728293031323334
  1. using Preparation.Utility;
  2. using System.Collections.Generic;
  3. namespace GameClass.GameObj
  4. {
  5. /// <summary>
  6. /// 箱子
  7. /// </summary>
  8. public class Chest : GameObj
  9. {
  10. public Chest(XY initPos) :
  11. base(initPos, GameData.numOfPosGridPerCell / 2, GameObjType.Chest)
  12. {
  13. this.place = PlaceType.Chest;
  14. this.CanMove = false;
  15. }
  16. public override bool IsRigid => true;
  17. public override ShapeType Shape => ShapeType.Square;
  18. private Prop[] propInChest = new Prop[GameData.maxNumOfPropInChest] { new NullProp(), new NullProp() };
  19. public Prop[] PropInChest => propInChest;
  20. private bool isOpen = false;
  21. public bool IsOpen
  22. {
  23. get => isOpen;
  24. set
  25. {
  26. lock (gameObjLock)
  27. isOpen = value;
  28. }
  29. }
  30. }
  31. }