Esempio n. 1
0
 private void CloseGate()
 {
     IsOpen = false;
     GameState.Current.ChangeFieldState(TileStates.Blocked, PassableFields());
     mCurrentModel = ModelManager.GetInstance().GateClosed;
     GameState.Current.SignalModelUpdate(ModelManager.GetInstance().Gate, this);
 }
Esempio n. 2
0
 private void OpenGate()
 {
     IsOpen = true;
     GameState.Current.ChangeFieldState(TileStates.Passable, PassableFields());
     mCurrentModel = ModelManager.GetInstance().Gate;
     GameState.Current.SignalModelUpdate(ModelManager.GetInstance().GateClosed, this);
 }
Esempio n. 3
0
 protected ATrackingUnit(ModelManager.Model model,
                         UnitTypes unitType,
                         Players owner,
                         Vector2 pos,
                         float rot,
                         int gridSize)
     : base(model, unitType, owner, pos, rot, gridSize)
 {
 }
Esempio n. 4
0
 protected AUnit(ModelManager.Model model, UnitTypes unitType, Players owner, Vector2 pos, int gridSize, float rotation)
 {
     ModelType      = model;
     GridSize       = gridSize;
     UnitType       = unitType;
     Position       = pos * gridSize;
     Rotation       = rotation;
     Owner          = owner;
     mModelOffset   = Matrix.CreateTranslation(gridSize / 2f, 0, gridSize / 2f);
     mReverseOffset = Matrix.CreateTranslation(gridSize / -2f, 0, gridSize / -2f);
 }
Esempio n. 5
0
 protected AMovableUnit(ModelManager.Model model,
                        UnitTypes unitType,
                        Players owner,
                        Vector2 pos,
                        float rot,
                        int gridSize)
     : base(model, unitType, owner, new Vector2(pos.X, pos.Y), gridSize, rot)
 {
     mOffset = new Vector2(gridSize / 2f);
     mWallCollisionCounter = 0;
     mMaxWallCollisions    = 90;
 }
Esempio n. 6
0
 protected ABuilding(ModelManager.Model model,
                     UnitTypes unitType,
                     Players owner,
                     Vector2 pos,
                     float rot,
                     int gridSize,
                     Point[] blockedFields  = null,
                     Point[] passableFields = null)
     : base(model, unitType, owner, pos, gridSize, rot)
 {
     mBlockedFields  = blockedFields ?? new [] { new Point(0, 0) };
     mPassableFields = passableFields ?? new Point[0];
     mGridPos        = pos;
 }
Esempio n. 7
0
 public BuildButton(ContentManager content,
                    int x,
                    int y,
                    int width,
                    int height,
                    UnitTypes?type,
                    bool gateToggle,
                    string[] text,
                    ModelManager.Model model) : base(content, x, y, width, height, text, boxColor: default, font: content.Load <SpriteFont>("fonts/small"))
 {
     mBuildingType  = type;
     mBuildingModel = model;
     mGateToggle    = gateToggle;
 }