00001 //BSD License 00002 //DXGfx® - http://www.eteractions.com 00003 //Copyright (c) 2005 00004 //by Guillaume Randon 00005 //Permission is hereby granted, free of charge, to any person obtaining a copy of this software 00006 //and associated documentation files (the "Software"), to deal in the Software without restriction, 00007 //including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 00008 //and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 00009 //subject to the following conditions: 00010 //The above copyright notice and this permission notice shall be included in all copies or substantial 00011 //portions of the Software. 00012 //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 00013 //INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 00014 //AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 00015 //DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 00016 //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 00017 using System; 00018 using System.Collections.Generic; 00019 using System.Text; 00020 using Microsoft.DirectX.DirectSound; 00021 using DXGfxLib; 00022 00023 namespace Game 00024 { 00025 public interface IWorldEntity 00026 { 00027 SceneObject SceneObject { get; set;} 00028 void Selected(); 00029 void UpdateIA(float elapsedTime, double absTime); 00030 } 00031 00032 public class WorldEntity :IWorldEntity 00033 { 00034 protected SceneObject sceneObj = new SceneObject(); 00035 00036 public SceneObject SceneObject 00037 { 00038 get { return sceneObj; } 00039 set { sceneObj = value; } 00040 } 00041 00042 public SecondaryBuffer selectSound; 00043 public String selectString; 00044 00045 public List<Mission> missions; 00046 00047 public WorldEntity() 00048 { 00049 missions = new List<Mission>(); 00050 channels = new List<IAChannel>(); 00051 } 00052 00053 public void Selected() 00054 { 00055 // Afficher le selectString + Jouer le selectSound!! 00056 // Lorsque le boutton avec le select string est appuyé on arrête le son en cours, on affiche le texte de la mission 00057 // et on joue le son associé !! 00058 } 00059 00060 public List<IAChannel> channels; 00061 public bool IAKnowledgeChanged = false; 00062 00063 public virtual void UpdateIA(float elapsedTime, double absTime) 00064 { 00065 foreach (IAChannel channel in channels) 00066 { 00067 channel.Run(this); 00068 } 00069 } 00070 } 00071 }
1.5.8