Beispiel #1
0
 //Mode bestimmt ob als Teil eines Templates oder aus einem File gesetzt werden soll. true ist hierbei ID, false=template
 public void setupObjectByCompact(CompactRPGObject o,bool mode)
 {
     this._name = o.name;
     bWeight = o.bWeight;
     bSizeCategory = o.bSizeCategory;
     if (mode) {
         cEffects=new List<TEffect>();
         AttributeHelper=new List<AttributModificationHelper>();
         if(o.cEffects!=null)
         foreach(TEffect e in o.cEffects)
             OnNewEffect(e);
         IDCounter = o.c;
     }
     else
         if(o.bEffects!=null)
         foreach (string effSting in o.bEffects)
             OnNewEffect( RPGCore.instance.spawnEffect (effSting));
     if(o.Information!=null)
         cInformation =new List<Content>(o.Information);
     updateStatistics ();
 }
Beispiel #2
0
 public override IDComponentUpdateMsg CreateInitialSetupMessage()
 {
     IDComponentUpdateMsg result = new IDComponentUpdateMsg ();
     result.componentName = GetType ().ToString ();
     result.id = getID ();
     result.updateType = 0;
     CompactRPGObject obj = new CompactRPGObject ();
     createCompactRPGObject (obj);
     result.data = FileHelper.serializeObject<CompactRPGObject> (obj);
     return result;
 }
Beispiel #3
0
 public override void serializeToFile(string FileName)
 {
     CompactRPGObject cO = new CompactRPGObject ();
     this.createCompactRPGObject(cO);
     FileHelper.WriteToFile (FileName, FileHelper.serializeObject<CompactRPGObject>(cO));
 }
Beispiel #4
0
 public void createCompactRPGObject(CompactRPGObject o)
 {
     o.bWeight = bWeight;
     o.bSizeCategory = cSizeCategory;
     o.cEffects =cEffects.ToArray();
     o.Information =cInformation.ToArray();
     o.c = IDCounter;
     o.name = _name;
 }