Beispiel #1
0
 public ScreenComponent(RheinwerkGame game)
     : base(game)
 {
     Game    = game;
     screens = new Stack <Screen>();
     icons   = new Dictionary <string, Texture2D>();
 }
        public SimulationComponent(RheinwerkGame game) : base(game)
        {
            this.game = game;

            // Spielwelt erzeugen
            NewGame();
        }
 public ScreenComponent(RheinwerkGame game)
     : base(game)
 {
     Game = game;
     screens = new Stack<Screen>();
     icons = new Dictionary<string, Texture2D>();
 }
Beispiel #4
0
 public SceneComponent(RheinwerkGame game)
     : base(game)
 {
     this.game       = game;
     tilesetTextures = new Dictionary <string, Texture2D>();
     itemTextures    = new Dictionary <string, Texture2D>();
     itemRenderer    = new Dictionary <Item, ItemRenderer>();
 }
 public SceneComponent(RheinwerkGame game)
     : base(game)
 {
     this.game = game;
     tilesetTextures = new Dictionary<string, Texture2D>();
     itemTextures = new Dictionary<string, Texture2D>();
     itemRenderer = new Dictionary<Item, ItemRenderer>();
 }
        public ServerComponent(RheinwerkGame game)
            : base(game)
        {
            this.game = game;

            clients = new List<Client>();
            items = new Dictionary<int, ItemCacheEntry>();
            quests = new Dictionary<string, QuestCacheEntry>();

            State = ServerState.Closed;
        }
Beispiel #7
0
        private void DoInteract(SimulationComponent simulation, IInteractor interactor, IInteractable interactable)
        {
            var quest = simulation.World.Quests.SingleOrDefault(q => q.Name == "Heidis Quest");

            before.Visible = quest.State == QuestState.Inactive;
            after.Visible  = quest.State == QuestState.Active && quest.CurrentProgress.Id == "return";

            RheinwerkGame game = simulation.Game as RheinwerkGame;

            simulation.ShowInteractionScreen(interactor as Player, new DialogScreen(game.Screen, this, interactor as Player, dialog));
        }
Beispiel #8
0
        public ServerComponent(RheinwerkGame game)
            : base(game)
        {
            this.game = game;

            clients = new List <Client>();
            items   = new Dictionary <int, ItemCacheEntry>();
            quests  = new Dictionary <string, QuestCacheEntry>();

            State = ServerState.Closed;
        }
Beispiel #9
0
        public MusicComponent(RheinwerkGame game) : base(game)
        {
            this.game = game;
            maxVolume = 0.5f;

            // Songs laden
            songs = new Dictionary <string, SoundEffect>();
            songs.Add("town", game.Content.Load <SoundEffect>("townloop"));
            songs.Add("menu", game.Content.Load <SoundEffect>("menuloop"));
            songs.Add("wood", game.Content.Load <SoundEffect>("woodloop"));
            songs.Add("house", game.Content.Load <SoundEffect>("houseloop"));
        }
        public MusicComponent(RheinwerkGame game) : base(game)
        {
            this.game = game;
            maxVolume = 0.5f;

            // Songs laden
            songs = new Dictionary<string, SoundEffect>();
            songs.Add("town", game.Content.Load<SoundEffect>("townloop"));
            songs.Add("menu", game.Content.Load<SoundEffect>("menuloop"));
            songs.Add("wood", game.Content.Load<SoundEffect>("woodloop"));
            songs.Add("house", game.Content.Load<SoundEffect>("houseloop"));
        }
Beispiel #11
0
        public Trader(int id) : base(id)
        {
            Texture = "trader.png";
            Name    = "Hardwig";
            Icon    = "tradericon.png";

            inventory = new List <Item>();

            OnInteract = (simulation, player, trader) =>
            {
                RheinwerkGame game = simulation.Game as RheinwerkGame;
                simulation.ShowInteractionScreen(player as Player, new TradeScreen(game.Screen, trader as IInventory, player as IInventory));
            };
        }
        public InputComponent(RheinwerkGame game)
            : base(game)
        {
            this.game = game;

            upTrigger = new Trigger();
            downTrigger = new Trigger();
            leftTrigger = new Trigger();
            rightTrigger = new Trigger();
            closeTrigger = new Trigger();
            inventoryTrigger = new Trigger();
            attackTrigger = new Trigger();
            interactTrigger = new Trigger();
            TouchPanel.EnableMouseTouchPoint = true;
        }
Beispiel #13
0
        public SoundComponent(RheinwerkGame game) : base(game)
        {
            this.game = game;
            volume    = 0.05f;

            sounds = new Dictionary <string, SoundEffect>();
            sounds.Add("click", game.Content.Load <SoundEffect>("click"));
            sounds.Add("clock", game.Content.Load <SoundEffect>("clock"));
            sounds.Add("coin", game.Content.Load <SoundEffect>("coin"));
            sounds.Add("hit", game.Content.Load <SoundEffect>("hit"));
            sounds.Add("sword", game.Content.Load <SoundEffect>("sword"));

            recoveryTimes = new Dictionary <IAttacker, TimeSpan>();
            hitpoints     = new Dictionary <IAttackable, int>();
        }
Beispiel #14
0
        public InputComponent(RheinwerkGame game)
            : base(game)
        {
            this.game = game;

            upTrigger        = new Trigger();
            downTrigger      = new Trigger();
            leftTrigger      = new Trigger();
            rightTrigger     = new Trigger();
            closeTrigger     = new Trigger();
            inventoryTrigger = new Trigger();
            attackTrigger    = new Trigger();
            interactTrigger  = new Trigger();
            TouchPanel.EnableMouseTouchPoint = true;
        }
        public SoundComponent(RheinwerkGame game) : base(game)
        {
            this.game = game;
            volume = 0.05f;

            sounds = new Dictionary<string, SoundEffect>();
            sounds.Add("click", game.Content.Load<SoundEffect>("click"));
            sounds.Add("clock", game.Content.Load<SoundEffect>("clock"));
            sounds.Add("coin", game.Content.Load<SoundEffect>("coin"));
            sounds.Add("hit", game.Content.Load<SoundEffect>("hit"));
            sounds.Add("sword", game.Content.Load<SoundEffect>("sword"));

            recoveryTimes = new Dictionary<IAttacker, TimeSpan>();
            hitpoints = new Dictionary<IAttackable, int>();
        }
Beispiel #16
0
        public ClientComponent(RheinwerkGame game)
            : base(game)
        {
            this.game = game;
            items     = new Dictionary <int, ItemCacheEntry>();

            // Buffer und Writer initialisieren
            readerBuffer = new byte[BUFFERSIZE];
            writerBuffer = new byte[BUFFERSIZE];
            writerStream = new MemoryStream(writerBuffer);
            writer       = new BinaryWriter(writerStream);

            State       = ClientState.Closed;
            ClientId    = 0;
            PlayerCount = 0;
            messages    = new ConcurrentQueue <Message>();
        }
Beispiel #17
0
        private void DoInteract(SimulationComponent simulation, IInteractor interactor, IInteractable interactable)
        {
            RheinwerkGame game = simulation.Game as RheinwerkGame;

            simulation.ShowInteractionScreen(interactor as Player, new ShoutScreen(game.Screen, this, "Bleib ein Weilchen und hoer zu!"));
        }
 public SimulationComponent(RheinwerkGame game) : base(game)
 {
     this.game = game;
 }
 public SceneComponent(RheinwerkGame game) : base(game)
 {
     this.game = game;
 }
 public SimulationComponent(RheinwerkGame game)
     : base(game)
 {
     this.game = game;
 }
 public LocalComponent(RheinwerkGame game)
     : base(game)
 {
     this.game = game;
 }
 public InputComponent(RheinwerkGame game) : base(game)
 {
     this.game = game;
 }
Beispiel #23
0
 public LocalComponent(RheinwerkGame game)
     : base(game)
 {
     this.game = game;
 }