private void CloseGate() { IsOpen = false; GameState.Current.ChangeFieldState(TileStates.Blocked, PassableFields()); mCurrentModel = ModelManager.GetInstance().GateClosed; GameState.Current.SignalModelUpdate(ModelManager.GetInstance().Gate, this); }
private void OpenGate() { IsOpen = true; GameState.Current.ChangeFieldState(TileStates.Passable, PassableFields()); mCurrentModel = ModelManager.GetInstance().Gate; GameState.Current.SignalModelUpdate(ModelManager.GetInstance().GateClosed, this); }
protected ATrackingUnit(ModelManager.Model model, UnitTypes unitType, Players owner, Vector2 pos, float rot, int gridSize) : base(model, unitType, owner, pos, rot, gridSize) { }
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); }
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; }
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; }
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; }